gaqprofessionals.blogg.se

Itextsharp check if pdf is signed
Itextsharp check if pdf is signed







itextsharp check if pdf is signed

I.t.p.s.OcspClientBounc圜astle INFO Getting OCSP from = Checking validity of the document at the time of signing = Revoked = crl.IsRevoked(pkcs7.SigningCertificate) Ĭonsole.WriteLine("Is certificate revoked?: " + revoked.ToString()) Īnd this is the output I get: = Signature2 = If (verification.Count = 0 & pkcs7.CRLs != null & != 0) This way, I can find out if the certificate is revoked or not (through CRL). Verification.AddRange(crlVerifier.Verify(signCert, issuerCert, date)) Ĭonsole.WriteLine("The signing certificate couldn't be verified with the example") įoreach (VerificationOK v in verification) OcspVerifier.Verify(signCert, issuerCert, date) ĬrlVerifier crlVerifier = new CrlVerifier(null, crls) OcspVerifier ocspVerifier = new OcspVerifier(null, ocsps) Public static void CheckRevocation(PdfPKCS7 pkcs7, X509Certificate signCert, X509Certificate issuerCert, DateTime date) X509Certificate issuerCert = (certs.Length > 1 ? certs : null) Ĭonsole.WriteLine("= Checking validity of the document at the time of signing =") ĬheckRevocation(pkcs7, signCert, issuerCert, cal) Ĭonsole.WriteLine("= Checking validity of the document today =") ĬheckRevocation(pkcs7, signCert, issuerCert, DateTime.Now) X509Certificate certs = pkcs7.SignCertificateChain PdfPKCS7 pkcs7 = fields.VerifySignature(name)

itextsharp check if pdf is signed

Public PdfPKCS7 VerifySignature(AcroFields fields, String name) Public void VerifySignatures(String path)Ĭonsole.WriteLine("= " + name + " =") LoggerFactory.GetInstance().SetLogger(new SysoLogger()) Ĭ5_03_CertificateValidation app = new C5_03_CertificateValidation() Īpp.VerifySignatures(EXAMPLE) //Pdf file I'm using to test the verification This is the code I'm using (short version of the example from the link above): static void Main(String args) The pdf I'm using to test the verification can be found in this link: I think that shouldn't happen, since Adobe Reader verificates the signatures ok.

itextsharp check if pdf is signed

Specifically, when trying to verify a signature through OCSP or CRL, the result usually is that the signature couldn't be verified.

itextsharp check if pdf is signed

I've followed the example in the iText web ( ) but the results aren't what I expected. I'm trying to verify digital signatures in c# using iTextSharp.









Itextsharp check if pdf is signed