RNCryptor
public enum RNCryptor
RNCryptor encryption/decryption interface.
-
Errors thrown by
See moreRNCryptorType
.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
throwsError
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
See morelatest.
Declaration
Swift
public final class Encryptor: RNCryptorType
-
Password-based decryptor that can handle any supported format.
See moreDeclaration
Swift
public final class Decryptor : RNCryptorType
-
V3 format settings
See moreDeclaration
Swift
public final class FormatV3
-
Format version 3 encryptor. Use this to ensure a specific format verison or when using keys (which are inherrently versions-specific). To use
See morethe latest encryptor
with a password, useEncryptor
instead.Declaration
Swift
public final class EncryptorV3 : RNCryptorType