----- Original Message ----- From: "Brian McKeever" <[EMAIL PROTECTED]> To: "Post all your questions about iText here" <itext-questions@lists.sourceforge.net> Sent: Monday, March 19, 2007 9:30 PM Subject: Re: [iText-questions] Signing PDF with Windows Certificates
>> itextsharp (and itext) is undergoing some major changes in the crypto >> area >> (see the CVS) and when the next release is out I'll prepare some examples >> on >> how to sign using certificates from the Windows certificate store >> supporting >> non exportable private keys like those coming from smartcards. You'll >> have >> to wait a couple of weeks for that. >> >> Paulo > > Hi Paulo, > > I was just wondering if you've gotten around to this yet. I was able > to get pretty far with this in iTextSharp 4. I'm just stuck on > converting the .Net X509Certificate2 to the BouncyCastle > X509Certificate (for the SetCrypto call). > If it's just that the way is to export the certificate as a byte array and import it in the other side. This will only give you the public key. If the key is not exportable you'll have to sign the pdf externally. I'll have to find the time to write some updated examples. Paulo > Thanks, > Brian > > -------------------------------- > > X509Certificate2 cert = (X509Certificate2)myStore.Certificates[0]; > > // Org.BouncyCastle.X509.X509Certificate bcCert = new > Org.BouncyCastle.X509.X509Certificate(cert.RawData); // compiled, but > did not produce valid sig in last version > > Org.BouncyCastle.X509.X509Certificate bcCert = new > Org.BouncyCastle.X509.X509Certificate(Org.BouncyCastle.Asn1.X509.X509CertificateStructure.GetInstance( > new Org.BouncyCastle.Asn1.Asn1InputStream(cert.RawData) )); // > compiles but fails at run time in iText4 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/