Skip to main content

Encrypt (NotesDatabase - LotusScript)

Encrypts a database.

Defined in

NotesDatabase

Syntax

To encrypt using default encryption strength and compact immediately:

Call notesDatabase .Encrypt( encryptionStrength , boolean defer**)**

If defer is set, encryption and compaction occur the next time the database is opened.

Parameters

encryptionStrength

Constant Specify the constant associated with the desired encryption strength.

StringDescription
DBENCRYPT_STRENGTH_NONEDatabase is not encrypted
DBENCRYPT_STRENGTH_SIMPLESimple database encryption strength. A deprecated strength that can be used only on a database with Simple or Medium encryption.
DBENCRYPT_STRENGTH_MEDIUMMedium database encryption strength. A deprecated strength that can be used only on a database with Simple or Medium encryption.
DBENCRYPT_STRENGTH_STRONGStrong database encryption strength.
DBENCRYPT_STRENGTH_AES128128-bit AES database encryption strength.
DBENCRYPT_STRENGTH_AES256256-bit AES database encryption strength.

defer

Specify true to wait and compact the database the first time it's opened. Specify false to compact the database immediately after encrypting it. Compacting is required to enable a new encryption strength.

Usage

Encrypting is done locally on a Domino server or Notes client. If run on the Notes client, encrypting requires Manager access in the database ACL. If run on the server, it requires Full administrator access to the server.

Compacting is required to encrypt a database. If defer isn't used and a database can't be immediately compacted, be assured that it will be encrypted the first time the database is opened after the call runs.

Note: The script does not always have exclusive access to the database. In this case, use of the defer option will ensure the method runs to completion.

Example

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.GetDatabase("", "encme.nsf")
Call db.encrypt(DBENCRYPT_STRENGTH_AES256,True)