Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) Verify XML Digital SignatureVerifies XML signatures in an XML file.
Use ChilkatAx-win32.pkg Procedure Test Variant vSbXml Handle hoSbXml Boolean iSuccess Handle hoDsig Integer i Boolean iBVerifyReferenceDigests Boolean iBVerified String sTemp1 // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatStringBuilder)) To hoSbXml If (Not(IsComObjectCreated(hoSbXml))) Begin Send CreateComObject of hoSbXml End Get ComLoadFile Of hoSbXml "qa_data/xml_dsig_verify/csioz_sample.xml" "utf-8" To iSuccess If (iSuccess <> True) Begin Showln "Failed to load XML file." Procedure_Return End Get Create (RefClass(cComChilkatXmlDSig)) To hoDsig If (Not(IsComObjectCreated(hoDsig))) Begin Send CreateComObject of hoDsig End // First load the XML containing the signatures to be verified. Get pvComObject of hoSbXml to vSbXml Get ComLoadSignatureSb Of hoDsig vSbXml To iSuccess If (iSuccess <> True) Begin Get ComLastErrorText Of hoDsig To sTemp1 Showln sTemp1 Procedure_Return End // It's possible that an XML document can contain multiple signatures. // Each can be verified as follows: Move 0 To i While (i < (ComNumSignatures(hoDsig))) // Select the Nth signature by setting the Selector property. Set ComSelector Of hoDsig To i // The bVerifyReferenceDigests argument determines if we want // to also verify each reference digest. If set to False, // then only the SignedInfo part of the Signature is verified. Move True To iBVerifyReferenceDigests Get ComVerifySignature Of hoDsig iBVerifyReferenceDigests To iBVerified Showln "Signature " (i + 1) " verified = " iBVerified Move (i + 1) To i Loop End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.