SetUserIDForDecrypt (NotesDatabase - LotusScript®)

After calling this method on a database, any document that is opened within the database is decrypted using the encryption keys within the userID object, as specified in the document SecretEncryptionKeys field.

Defined in

NotesDatabase

Syntax

call notesDatabase.setUserIDForDecrypt(uid)

call notesDatabase.setUserIDForDecrypt(idfile, password)
Parameter Description
uid NotesUserID (type). After setting the User id, documents in this database will be decrypted with encryption keys of this user id
idfile String. Provides the file path of id file. After setting it, all documents in this database will be decrypted with encryption keys of this id file.
password String. After setting the User id, documents in this database will be decrypted with encryption keys of this user id

Example

This code provides an example of how to use this method:

Dim session As New NotesSession
	Dim id As notesIDVault
	Dim ui As notesUserID
	
	Dim db1 As NotesDatabase
	Dim doc1 As NotesDocument
	Dim vec1 As variant
	Dim db2 As NotesDatabase
	Dim doc2 As NotesDocument
	Dim vec2 As variant

	Set db = session.getDatabase("TEST", "test1.nsf")
	Call db.Setuseridfilefordecrypt("c:\1.id", "12345")
	Set doc1 = db1.Alldocuments.Getfirstdocument()
	vec1 = doc1.Getitemvalue("item1")
	Call db1.Setuseridfilefordecrypt("","")	



	Set id = session.getIDVault()
	Set ui = iv.Getuserid("test vault2/IBM", "12345", "TEST/IBM")
	Set db2 = session.getDatabase("TEST", "test2.nsf")
	Call db2.Setuseridfordecrypt(ui)
	Set doc2 = db2.Alldocuments.Getfirstdocument()
	vec2 = doc2.Getitemvalue("item2")	
	Call db2.Setuseridfordecrypt(Nothing)