(AutoIt) Extract XML string from a .p7m byte array (e.g. FATTURA ELETTRONICA, ITALY)
AutoIt example to extract the original XML from a .p7m (Signed-Data PKCS7 Format) provided as a byte array.
One use for this example is to extract the original XML from a Fattura Elettronica .p7m signature.
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oFac = ObjCreate("Chilkat_9_5_0.FileAccess")
Local $oP7mBytes
$oP7mBytes = $oFac.ReadEntireFile("testData/p7m/fattura_signature.p7m")
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
$oCrypt = ObjCreate("Chilkat_9_5_0.Crypt2")
Local $sOriginalXml = $oCrypt.OpaqueVerifyString($oP7mBytes)
If ($oCrypt.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Original XML:" & @CRLF)
ConsoleWrite($sOriginalXml & @CRLF)
ConsoleWrite("Success!" & @CRLF)
|