RNCryptor

public enum RNCryptor

RNCryptor encryption/decryption interface.

  • Errors thrown by RNCryptorType.

    See more

    Declaration

    Swift

    public enum Error : Int, Swift.Error
  • Encrypt data using password and return encrypted data.

    Declaration

    Swift

    public static func encrypt(data: Data, withPassword password: String) -> Data
  • Decrypt data using password and return decrypted data. Throws if password is incorrect or ciphertext is in the wrong format.

    Throws

    throws Error

    Declaration

    Swift

    public static func decrypt(data: Data, withPassword password: String) throws -> Data
  • Generates random Data of given length Crashes if length is larger than allocatable memory, or if the system random number generator is not available.

    Declaration

    Swift

    public static func randomData(ofLength length: Int) -> Data
  • 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.”

    See more

    Declaration

    Swift

    public final class Encryptor : RNCryptorType
  • Password-based decryptor that can handle any supported format.

    See more

    Declaration

    Swift

    public final class Decryptor : RNCryptorType