Manage Learn to apply best practices and optimize your operations.

Check for encryption key

This tip describes how to check for encryption keys.

Does a user have a specific encryption key attached to her ID file? Use this script function to find out.

The example displays a dialogbox showing if the current user owns encryption key "SampleKey". This could also be used to send an e-mail report on which users have a given key, or to set field values and display customized content based on whether or not the user owns the encryption key.

 'CALLING THE FUNCTION Sub Click(Source As Button) Const keyname = "SampleKey" If UserOwnsEncryptionKey(keyname) Then Msgbox "Key " & keyname & " is attached to your ID file." Else Msgbox "Key " & keyname & " is not attached to your ID file." End If End Sub 'FUNCTION ITSELF %INCLUDE "lserr.lss" Function UserOwnsEncryptionKey(keyname As String) 'Error 4000 occurs when calling testdoc.Encrypt if the user does not have the key whose name is passed to the function On Error 4000 Goto processError Dim ss As New NotesSession Dim db As NotesDatabase Dim testdoc As NotesDocument Dim item1 As NotesItem Set db = ss.CurrentDatabase Set testdoc = New NotesDocument(db) Set item1 = testdoc.AppendItemValue( "Test", "abc" ) item1.IsEncrypted = True testdoc.EncryptionKeys = keyname Call testdoc.Encrypt UserOwnsEncryptionKey = True Exit Function processError: UserOwnsEncryptionKey = False Exit Function End Function

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...