Decryptor

public final class Decryptor : RNCryptorType

Password-based decryptor that can handle any supported format.

  • Creates and returns a cryptor.

    Declaration

    Swift

    public init(password: String)

    Parameters

    password

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

  • Decrypt data using password and return decrypted data, invalidating decryptor. Throws if password is incorrect or ciphertext is in the wrong format.

    Throws

    throws Error

    Declaration

    Swift

    public func decrypt(data: Data) throws -> Data
  • Updates cryptor with data and returns processed data.

    Throws

    Error

    Declaration

    Swift

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

    Parameters

    data

    Data to process. May be empty.

    Return Value

    Processed data. May be empty.

  • Returns trailing data and invalidates the cryptor.

    Throws

    Error

    Declaration

    Swift

    public func finalData() throws -> Data

    Return Value

    Trailing data