Encryptor

public final class Encryptor : RNCryptorType

A encryptor for the latest data format. If compatibility with other RNCryptor implementations is required, you may wish to use the specific encryptor version rather than accepting “latest.”

  • Creates and returns a cryptor.

    Declaration

    Swift

    public init(password: String)

    Parameters

    password

    Non-empty password string. This will be interpretted as UTF-8.

  • Updates cryptor with data and returns processed data.

    Declaration

    Swift

    public func update(withData data: Data) -> Data

    Parameters

    data

    Data to process. May be empty.

    Return Value

    Processed data. May be empty.

  • Returns trailing data and invalidates the cryptor.

    Declaration

    Swift

    public func finalData() -> Data

    Return Value

    Trailing data

  • Simplified, generic interface to RNCryptorType. Takes a data, returns a processed data, and invalidates the cryptor.

    Declaration

    Swift

    public func encrypt(data: Data) -> Data