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
(Visual FoxPro) Verify XAdES with External File ReferenceDemonstrates how to validate an XML digital signature that contains a reference to an external file. (This is one way of doing it..)
LOCAL loSbXml LOCAL lnSuccess LOCAL loValidator LOCAL i LOCAL lnValid * This example requires the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * Load the XAdES file to be validated.. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder') loSbXml = CreateObject('Chilkat.StringBuilder') lnSuccess = loSbXml.LoadFile("qa_data/xml_dsig_valid_samples/externalFile/test.pdf.XAdES","utf-8") IF (lnSuccess = 0) THEN ? "Failed to load XAdES input file." RELEASE loSbXml CANCEL ENDIF * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.XmlDSig') loValidator = CreateObject('Chilkat.XmlDSig') * Specify a set of absolute or relative directory paths to be searched for any external file references. * Directory paths are separated by semicolon chars. loValidator.ExternalRefDirs = "qa_data/externalFiles;qa_data/xml_dsig_valid_samples/externalFile;c:/someOtherDir" lnSuccess = loValidator.LoadSignatureSb(loSbXml) IF (lnSuccess = 0) THEN ? loValidator.LastErrorText RELEASE loSbXml RELEASE loValidator CANCEL ENDIF * Validate signatures as usual.. i = 0 DO WHILE i < loValidator.NumSignatures loValidator.Selector = i lnValid = loValidator.VerifySignature(1) ? "Signature " + STR(i + 1) + " and all reference digests OK = " + STR(lnValid) i = i + 1 ENDDO RELEASE loSbXml RELEASE loValidator |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.