Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::EncryptionKey Class Reference

A database encryption key, used in DatabaseConfiguration to open or create an encrypted database. More...

#include <cbl++/Database.hh>

Inheritance diagram for cbl::EncryptionKey:
CBLEncryptionKey

Public Member Functions

 EncryptionKey ()
 Creates an empty key (algorithm kCBLEncryptionNone, i.e.
 EncryptionKey (const CBLEncryptionKey &k)
 Creates a key from an existing C CBLEncryptionKey.
 EncryptionKey (std::string_view password, bool old=false)
 Derives an AES-256 key from a password.
EncryptionKeyoperator= (const CBLEncryptionKey &k)
 Assigns from an existing C CBLEncryptionKey.

Additional Inherited Members

Public Attributes inherited from CBLEncryptionKey
CBLEncryptionAlgorithm algorithm
uint8_t bytes [32]

Detailed Description

A database encryption key, used in DatabaseConfiguration to open or create an encrypted database.

Note
ENTERPRISE EDITION ONLY

Constructor & Destructor Documentation

◆ EncryptionKey() [1/3]

cbl::EncryptionKey::EncryptionKey ( )
inline

Creates an empty key (algorithm kCBLEncryptionNone, i.e.

no encryption).

◆ EncryptionKey() [2/3]

cbl::EncryptionKey::EncryptionKey ( const CBLEncryptionKey & k)
inline

Creates a key from an existing C CBLEncryptionKey.

Parameters
kThe C encryption key to copy.

◆ EncryptionKey() [3/3]

cbl::EncryptionKey::EncryptionKey ( std::string_view password,
bool old = false )
inline

Derives an AES-256 key from a password.

Parameters
passwordThe password to derive the key from.
oldIf true, uses the legacy (SHA-1-based) derivation; otherwise uses the current (SHA-256-based) derivation. Pass true only to open databases created with the older algorithm.

Member Function Documentation

◆ operator=()

EncryptionKey & cbl::EncryptionKey::operator= ( const CBLEncryptionKey & k)
inline

Assigns from an existing C CBLEncryptionKey.


The documentation for this class was generated from the following file: