Products Support Documentation Download
Encryption Functions
Collaboration diagram for Encryption Functions:

Functions

RDM_RETCODE rdm_dbEncrypt (RDM_DB db, RDM_ENCRYPT enc, const RDM_TCHAR_T *optString)
 Encrypt a database. More...
 
RDM_RETCODE rdm_dbGetEncrypt (RDM_DB db, RDM_ENCRYPT *enc)
 Get the encryption context associated with a database handle. More...
 
RDM_RETCODE rdm_dbSetEncrypt (RDM_DB db, RDM_ENCRYPT enc)
 Associate an encryption context with a database handle. More...
 

Detailed Description

Encryption API for a database. All the fuctions here are located in RDM DB Engine Library. Linker option:

    -lrdmrdm

Additional API for instantiating an encryption context consult Instantiating Encryption Context.

Function Documentation

◆ rdm_dbEncrypt()

RDM_RETCODE rdm_dbEncrypt ( RDM_DB  db,
RDM_ENCRYPT  enc,
const RDM_TCHAR_T optString 
)

#include <rdmdbapi.h>

Encrypt a database.

This function can encrypt, decrypt, and re-encrypt an existing RDM database.

When re-encrypting a database image you can choose whether to do a full or quick re-encryption. A quick re-encryption will just change the passcode used for encrypting the randomly generated key used to encrypt the actual database contents. In this case the database contents do not need to be read and rewritten so the operation can be performed very quickly.

A full re-encryption will generate a new internal encryption key and will require each database page to be read, decrypted, re-encrypted, and rewritten to the file. This can be a lengthy operation for very large database images.

To decrypt an encrypted database pass in a NULL encryption context (enc).

Locking Requirements
This function requires that the database be opened in exclusive mode.
Return values
sOKAYNormal, successful return.
eDBNOTOPENDatabase not open.
eEXCLUSIVEExclusive access required.
eTRACTIVETransaction is active.
See also
rdm_dbOpen
rdm_tfsAllocEncrypt
rdm_dbGetEncrypt
Parameters
[in]dbA valid RDM database handle
[in]encThe new encryption context (can be NULL to decrypt)
[in]optStringA semicolon delimited string that contains the utility options

◆ rdm_dbGetEncrypt()

RDM_RETCODE rdm_dbGetEncrypt ( RDM_DB  db,
RDM_ENCRYPT enc 
)

#include <rdmdbapi.h>

Get the encryption context associated with a database handle.

This function allows the application to retrive the encryption context associated with a database handle. It is possible that multiple encryption contexts are associated with a database handle. If that is the case this function will return the most recently associated encryption context.

Locking Requirements
None
Return values
sOKAYNormal, successful return.
See also
rdm_tfsAllocDatabase
rdm_dbSetEncrypt
rdm_tfsGetEncrypt
Parameters
[in]dbA valid RDM database handle
[in]encA pointer to an encryption context

◆ rdm_dbSetEncrypt()

RDM_RETCODE rdm_dbSetEncrypt ( RDM_DB  db,
RDM_ENCRYPT  enc 
)

#include <rdmdbapi.h>

Associate an encryption context with a database handle.

This function will associate an encryption context to a database handle. When a database is opened the system will us the encryption contexts associated with the handle to attempt to open the database.

Typically you would associate the encryption context to a handle prior to open a database.

You can remove all encryption contexts associated with the handle by passing in a NULL encryption context to this function.

Locking Requirements
None.
Return values
sOKAYNormal, successful return.
eDBOPENDatabase already opened in this task.
ePRECOMMITTEDA precommitted transaction must be committed or rolled back before further operations on this database are allowed.
See also
rdm_tfsAllocEncrypt
rdm_dbEncrypt
rdm_dbGetEncrypt
Parameters
[in]dbA valid RDM database handle
[in]encAn RDM_ENCRYPT to associate with db (can be NULL to remove all contexts associated with db)