Sample code for 30+ languages & platforms
Visual Basic 6.0

Example: Crypt2.GetSignedAttributes method

Demonstrates how to call the GetSignedAttributes method.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim crypt As New ChilkatCrypt2

Dim bdPkcs7 As New ChilkatBinData
success = bdPkcs7.LoadFile("qa_data/cades/CAdES-T/Signature-C-T-1.p7m")
If (success = 0) Then
    Debug.Print bdPkcs7.LastErrorText
    Exit Sub
End If

Dim json As New ChilkatJsonObject
json.EmitCompact = 0

Dim sbJson As New ChilkatStringBuilder
Dim i As Long
i = 0
Dim tryNext As Long
tryNext = 1
Do While tryNext
    If (crypt.GetSignedAttributes(i,bdPkcs7,sbJson) = 1) Then
        success = json.LoadSb(sbJson)
        Debug.Print i & ": "
        Debug.Print json.Emit()
    Else
        tryNext = 0
    End If

    i = i + 1
Loop

' Sample output:

' 0: 
' {
'   "signedAttributes": [
'     {
'       "oid": "1.2.840.113549.1.9.3",
'       "name": "Content Type"
'     },
'     {
'       "oid": "1.2.840.113549.1.9.5",
'       "name": "Signing Time"
'     },
'     {
'       "oid": "1.2.840.113549.1.9.4",
'       "name": "Message Digest"
'     },
'     {
'       "oid": "1.2.840.113549.1.9.16.2.47",
'       "name": "Signing Certificate V2"
'     }
'   ]
' }