例: AddInternetCertificateToUser method

次の例では、AdminID により承認されたインターネット証明書を Amy Andrews/Sales の Software_server に追加します。

Sub Initialize
    Set session = New NotesSession      'obtain a new NotesSession object 
    Dim ws As NotesUIWorkspace
    Dim adminP As NotesAdministrationProcess
    Set adminP = session.CreateAdministrationProcess( "Software_server" )

    ' set variables for internet certificate and certifierID
    Dim certDate As NotesDateTime
    Set certDate = New NotesDateTime( "Today" )
    Call certDate.AdjustDay( 5 )
    Dim noteID As String
    Dim certID As String
    certID = "d:¥¥NotesAdministrator¥AdminID.id"

    ' set variables for username and keyring
    Dim username As String
    username =  "Amy Andrews/Sales"
    Dim keyRing As String
    keyRing = "d:¥¥NotesAdministrator¥keyfile.kyr"
    Dim keyRingFilePW As String

    Dim useCA As Boolean
    useCA = False
    Dim certOrg As String
    certOrg="/APCABE"

    Set adminP.CertificateExpiration =  certDate
    If useCA Then
        If adminP.IsCertificateAuthorityAvailable Then
            adminP.CertificateAuthorityOrg = certOrg
            adminP.UseCertificateAuthority = True
        End If
    Else
        adminP.CertifierFile = certID
        adminP.CertifierPassword = InputBox$("Enter certification password")
        adminP.UseCertificateAuthority = False
    End If

    keyRingFilePW = InputBox$("Enter the key ring file password")
    noteID = adminP.AddInternetCertificateToUser(username,keyRing,_
keyRingFilePW)
End Sub