LOTUSSCRIPT/COM/OLE CLASSES


Encrypt method
Example

Encrypts a document in a database.

Defined in

NotesDocument

Syntax

Call notesDocument.Encrypt

Usage

The encrypted document is not written to disk until you call the Save method. Only the items for which the IsEncrypted property is True are encrypted. Items for which the IsEncrypted property is False remain visible to any user, even if the user does not have the proper encryption key.

If the EncryptionKeys property is set with one or more named keys, those keys are used to encrypt the document. Any user who has one of the encryption keys can decrypt the document. If there are no encryption keys specified, the document is encrypted with the user's public key, in which case only the user who encrypted the document can decrypt it.

If the script is running on a server, it must have permission to use Encrypt. If the script is part of a scheduled agent running in the background on a server, and the EncryptionKeys property is set with one or more named keys, the server's ID must contain those keys, not the signer of the agent. The agent must also have a runtime security level of at least "Allow restricted operations".

Since mail encryption works differently, don't use this method if you want to mail an encrypted document. Instead, set the EncryptOnSend property to True, and use the Send method.

You cannot use the encrypt method on a Document object returned by the DocumentContext property.

Language cross-reference

encrypt method in Java Document class

Example
See Also