(AutoIt) Verify the Timestamp Server Token (if any) while Validating a CMS Signature
Demonstrates how to also validate the timestamp server token (if any) while validating a CMS signature.
$oCrypt = ObjCreate("Chilkat.Crypt2")
; Tell Chilkat to also validate the timestamp token if a timestamp exists in the CMS message's unauthenticated attributes.
$oCmsOptions = ObjCreate("Chilkat.JsonObject")
$oCmsOptions.UpdateBool("ValidateTimestampTokens",True)
$oCrypt.CmsOptions = $oCmsOptions.Emit()
Local $sOutputFile = "qa_output/original.xml"
Local $sInFile = "qa_data/p7m/fattura_signature.xml.p7m"
; Verify the signature and extract the contained file, which in this case is XML.
Local $bSuccess = $oCrypt.VerifyP7M($sInFile,$sOutputFile)
If ($bSuccess = False) Then
ConsoleWrite($oCrypt.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Signature validated." & @CRLF)
|