CBLEncryptionKey

@interface CBLEncryptionKey : NSObject

The encryption key, a raw AES-256 key data which has exactly 32 bytes in length or a password string. If the password string is given, it will be internally converted to a raw AES key using 64,000 rounds of PBKDF2 hashing.

  • Initializes the encryption key with a raw AES-256 key data which has 32 bytes in length. To create a key, generate random data using a secure cryptographic randomizer like SecRandomCopyBytes or CCRandomGenerateBytes.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithKey:(nonnull NSData *)key;

    Parameters

    key

    The raw AES-256 key data.

    Return Value

    The CBLEncryptionKey object.

  • Initializes the encryption key with the given password string. The password string will be internally converted to a raw AES-256 key using 64,000 rounds of PBKDF2 hashing.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPassword:(nonnull NSString *)password;

    Parameters

    password

    The password string.

    Return Value

    The CBLEncryptionKey object.