Creating a Digital Signature Example for Visual Basic
Sub CreateSignature(objDS As LEADDicomDS)
Dim nRet As Integer
' Create a Digital Signature in the main Data Set
objDS.SetCurrentElement 0
nRet = objDS.CreateSignature ("C:\PrivateKey", "C:\Certificate.cer", "")
If nRet = DICOM_SUCCESS Then
MsgBox "The Digital Signature was created successfully.", , "Sample"
Else
MsgBox "An error occurred [Error: " & nRet & "].", , "Sample"
Exit Sub
End If
' Save the signed Data Set
objDS.SaveDS "C:\Signed.dic", 0
' Examine the Digital Signature we just created
' Refer to Examining a Digital Signature Example for Visual Basic
' for the procedure ExamineSignature
ExamineSignature objDS, objDS.CurrentElement.hElement
End Sub