Classic ASP
Classic ASP
Example: Crypt2.GetSignedAttributes method
Demonstrates how to call the GetSignedAttributes method.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set crypt = Server.CreateObject("Chilkat.Crypt2")
set bdPkcs7 = Server.CreateObject("Chilkat.BinData")
success = bdPkcs7.LoadFile("qa_data/cades/CAdES-T/Signature-C-T-1.p7m")
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( bdPkcs7.LastErrorText) & "</pre>"
Response.End
End If
set json = Server.CreateObject("Chilkat.JsonObject")
json.EmitCompact = 0
set sbJson = Server.CreateObject("Chilkat.StringBuilder")
i = 0
tryNext = 1
Do While tryNext
If (crypt.GetSignedAttributes(i,bdPkcs7,sbJson) = 1) Then
success = json.LoadSb(sbJson)
Response.Write "<pre>" & Server.HTMLEncode( i & ": ") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( json.Emit()) & "</pre>"
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"
' }
' ]
' }
%>
</body>
</html>