Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(VB.NET UWP/WinRT) Sign PDF for ICP-BrasilSee more PDF Signatures ExamplesSign a PDF to create a signed PDF compliant with the ICP-Brasil Digital Signature Standard Conformity Checker. (Verificador de Conformidade do PadrĂ£o de Assinatura Digital ICP-Brasil) Note: This example requires Chilkat v9.5.0.87 or greater. For more information, see https://verificador.iti.gov.br/verifier-2.6.2/
' This example requires the Chilkat API to have been previously unlocked. ' See Global Unlock Sample for sample code. ' The signed PDF produced by this example should be verifiable at https://verificador.iti.gov.br/verifier-2.6.2/ Dim pdf As New Chilkat.Pdf ' Load a PDF to be signed. ' The "hello.pdf" is available at https://chilkatsoft.com/hello.pdf Dim success As Boolean = pdf.LoadFile("qa_data/pdf/hello.pdf") If (success = False) Then Debug.WriteLine(pdf.LastErrorText) Exit Sub End If Dim json As New Chilkat.JsonObject ' Define the appearance and location of the signature. json.UpdateInt("page",1) json.UpdateString("appearance.y","bottom") json.UpdateString("appearance.x","middle") json.UpdateString("appearance.fontScale","9.0") json.UpdateString("appearance.text[0]","Digitally signed by: cert_cn") json.UpdateString("appearance.text[1]","current_dt") json.UpdateString("appearance.image","document-accepted") json.UpdateString("appearance.imagePlacement","left") json.UpdateString("appearance.imageOpacity","100") ' Add the CMS options required for ICP-Brasil json.UpdateInt("contentType",1) json.UpdateInt("messageDigest",1) json.UpdateInt("signingCertificateV2",1) json.UpdateString("policyId.id","2.16.76.1.7.1.1.2.3") json.UpdateString("policyId.hash","sW6Iu/dzIqZ5lbeQeHeO09DqfIhYe29tUYtxXo92o9U=") json.UpdateString("policyId.uri","http://politicas.icpbrasil.gov.br/PA_AD_RB_v2_3.der") json.UpdateString("policyId.hashAlg","SHA256") ' Load the signing certificate. (Use your own certificate.) ' Note: If loading from a smart card, call LoadFromSmartcard instead, and make sure to use Chilkat v9.5.0.88 or later. Dim cert As New Chilkat.Cert success = cert.LoadPfxFile("qa_data/pfx/myPdfSigningCert.pfx","pfx_password") If (success = False) Then Debug.WriteLine(cert.LastErrorText) Exit Sub End If ' Tell the pdf object to use the certificate for signing. success = pdf.SetSigningCert(cert) If (success = False) Then Debug.WriteLine(pdf.LastErrorText) Exit Sub End If success = Await pdf.SignPdfAsync(json,"qa_output/hello_signed.pdf") If (success = False) Then Debug.WriteLine(pdf.LastErrorText) Exit Sub End If Debug.WriteLine("The PDF has been successfully cryptographically signed.") |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.