Sample code for 30+ languages & platforms
AutoIt

Extract XML string from a .p7m byte array (e.g. FATTURA ELETTRONICA, ITALY)

See more Digital Signatures Examples

_LANGUAGE_ 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.

Chilkat AutoIt Downloads

AutoIt
;  This example requires the Chilkat API to have been previously unlocked.
;  See Global Unlock Sample for sample code.

$oFac = ObjCreate("Chilkat.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.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)