Hi, I'm trying to use the windows certificate store to store the certificates and use iTextSharp to take the certs from that store and sign the doc. It works great, as long as it doesn't require any form of chain to get to a trusted root. I've tried adding the entire chain into the array of certificates, in both root cert first, signing one last and signing one first the root last. But adobe is showing that only the signing cert is being put in. And as the size of the pdf document doesn't change whether the other ones are there or not, I'm more inclined to say that iTextSharp is not including them in the pdf document. Can someone help me use a chain with windows certificates? Here's the code that I currently have. On the system that has the certificate to sign with, adobe is showing that it's perfectly fine. And with 2 certificate paths? Any ideas? I'm really not wanting to store the certificate in a file on the server. Thanks for any help you can offer.
X509Store x509Store = new X509Store(StoreName.My, StoreLocation.LocalMachine); x509Store.Open(OpenFlags.ReadOnly); X509Certificate2 x509Cert = x509Store.Certificates.Find( X509FindType.FindByThumbprint, System.Configuration.ConfigurationManager.AppSettings["PDFCertificateThumbprint"], false)[0]; X509Chain chain1 = X509Chain.Create(); chain1.Build(x509Cert); OrgX509.X509CertificateParser cp = new OrgX509.X509CertificateParser(); OrgX509.X509Certificate[] chain = new OrgX509.X509Certificate[chain1.ChainElements.Count]; for (int x = 0; x < chain.Count(); x++) { chain[x] = cp.ReadCertificate(chain1.ChainElements[x].Certificate.GetRawCertData()); } sap.SetCrypto(null, chain, null, PdfSignatureAppearance.VERISIGN_SIGNED); [https://images.mtnam.org/images/image.aspx/2735/e913f29f/1/100/126/1] Edward Cooke Programmer II, Information Systems +1 801-325-6143 tel +1 801-898-5940 cell eco...@macu.com http://www.macu.com [https://images.mtnam.org/marketing/image.aspx/e913f29f]<https://images.mtnam.org/marketing/image.aspx/1> [https://images.mtnam.org/marketing/image.aspx/2/fb]<https://images.mtnam.org/marketing/image.aspx/3/fb> [https://images.mtnam.org/marketing/image.aspx/2/tw] <https://images.mtnam.org/marketing/image.aspx/3/tw> ________________________________ ***Confidentiality and Security Notice: This message and any attachments are intended only for the use of the individual or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient you are hereby notified that any dissemination, copying, or distribution of this message, or attachments, is strictly prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete it from your computer. Do not send sensitive data via unencrypted email as it may be intercepted in transit***
------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php