Protocols

The following protocols are available globally.

  • The RNCryptorType protocol defines generic API to a mutable, incremental, password-based encryptor or decryptor. Its generic usage is as follows:

    let cryptor = Encryptor(password: "mypassword")
    // or Decryptor()
    
    var result NSMutableData
    for data in datas {
        result.appendData(try cryptor.update(data))
    }
    result.appendData(try cryptor.final())
    

    After calling finalData(), the cryptor is no longer valid.

    See more

    Declaration

    Swift

    public protocol RNCryptorType