public virtual void ValidLtvDocTest02() { String ltvTsFileName = sourceFolder + "ltvDoc.pdf"; LtvVerifier verifier = new LtvVerifier(new PdfDocument(new PdfReader(ltvTsFileName))); verifier.SetCertificateOption(LtvVerification.CertificateOption.WHOLE_CHAIN); verifier.SetRootStore(Pkcs12FileHelper.InitStore(certsSrc + "rootStore.p12", password)); IList <VerificationOK> verificationMessages = verifier.Verify(null); NUnit.Framework.Assert.AreEqual(7, verificationMessages.Count); }
public virtual void ValidCertificateChain01() { X509Certificate[] certChain = Pkcs12FileHelper.ReadFirstChain(certsSrc + "signCertRsaWithChain.p12", password ); String caCertFileName = certsSrc + "rootRsa.p12"; List <X509Certificate> caKeyStore = Pkcs12FileHelper.InitStore(caCertFileName, password); IList <VerificationException> verificationExceptions = CertificateVerification.VerifyCertificates(certChain , caKeyStore); NUnit.Framework.Assert.IsTrue(verificationExceptions.IsEmpty()); }