ValidateSignature Method Example

The following example creates the ESignature object, checks to see if the node is enabled for electronic signature, validates the signature, sends a message to the audit trail, and retrieves the full name of the signer.

Dim ESig As Object

Dim bNodeSignEnabled As Boolean

Dim bValidSig As Boolean

Dim UserID As String

Dim FullName As String

'Create the ESignature object

Set ESig = CreateObject("ElectronicSignature.ESignatureFactory")

'Check if node is enabled for electronic signature

ESig.IsNodeSignEnabled bNodeSignEnabled

If bNodeSignEnabled = True Then

bValidSig = False ' will be set to TRUE by ValidateSignature if signature is valid

'Validate the signature

ESig.ValidateSignature "admin", "admin", 1, bValidSig, Ucase(UserID)

If bValidSig = True Then

'Send a message to the audit trail

ESig.SendSignedOperatorMessage "Action Description", "", "", Ucase(UserID), "Comment"

'Get the full name of the signer

ESig.GetFullname Ucase(UserID), Ucase(FullName)

'Show Results

MsgBox "Action performed by admin (" + FullName + ") " + "Comment"

Else

MsgBox "Invalid Signature."

End If

Else

MsgBox "Signature is not enabled on this node."

End If