![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PureBasic) Verify the Timestamp Server Token (if any) while Validating a CMS SignatureDemonstrates how to also validate the timestamp server token (if any) while validating a CMS signature.
IncludeFile "CkCrypt2.pb" IncludeFile "CkJsonObject.pb" Procedure ChilkatExample() crypt.i = CkCrypt2::ckCreate() If crypt.i = 0 Debug "Failed to create object." ProcedureReturn EndIf ; Tell Chilkat to also validate the timestamp token if a timestamp exists in the CMS message's unauthenticated attributes. cmsOptions.i = CkJsonObject::ckCreate() If cmsOptions.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkJsonObject::ckUpdateBool(cmsOptions,"ValidateTimestampTokens",1) CkCrypt2::setCkCmsOptions(crypt, CkJsonObject::ckEmit(cmsOptions)) outputFile.s = "qa_output/original.xml" inFile.s = "qa_data/p7m/fattura_signature.xml.p7m" ; Verify the signature and extract the contained file, which in this case is XML. success.i = CkCrypt2::ckVerifyP7M(crypt,inFile,outputFile) If success = 0 Debug CkCrypt2::ckLastErrorText(crypt) CkCrypt2::ckDispose(crypt) CkJsonObject::ckDispose(cmsOptions) ProcedureReturn EndIf Debug "Signature validated." CkCrypt2::ckDispose(crypt) CkJsonObject::ckDispose(cmsOptions) ProcedureReturn EndProcedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.