  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | RES: Digital Signature | RES: Digital Signature 2006-07-24 - By Junior + Suporte
Back I following this example: http://article.gmane.org/gmane.comp.windows.dotnet.itextsharp.general/12
I export the X509Certificate2 to byte[] and import into a PKCS12Store object, with MemoryStream, and into a bouncycastles X509Certificate object:
<CODE> cert = new org.bouncycastle.x509.X509Certificate(Certificado.Export(X509ContentType.Cer t)); PKCS12Store p12 = new PKCS12Store(new MemoryStream(Certificado.Export(X509ContentType.Pkcs12)), "".ToCharArray()); string alias = p12.getCertificateAlias(cert); </CODE>
The string alias is null, the sign function finally successfully, but the output pdf have 0kb.
Luiz Carlos Zancanella Junior
-- --Mensagem original-- -- De: itext-questions-bounces@(protected) [mailto:itext-questions-bounces@(protected)] Em nome de Paulo Soares Enviada em: domingo, 23 de julho de 2006 18:50 Para: Post all your questions about iText here Assunto: Re: [iText-questions] Digital Signature
You get your X509Certificate2, export it to a byte array and create a new bouncycastle certificate with it.
Paulo
-- -- Original Message -- -- From: "Junior + Suporte" <junior@(protected)> To: <itext-questions-request@(protected)>; <itext-questions@(protected)> Sent: Sunday, July 23, 2006 7:54 PM Subject: [iText-questions] Digital Signature
> Hi all, > > I'm trying to Sign a PDF with iTextSharp, I have found a lot of example in > the internet, but all talks about digital sign with a PFX file, I want to > sign a PDF with an certificate stored in the Microsoft Store (my). C# have
> a > function to get the certificates from My, but this function return a > certificate in X509Certificate2 object, and this type is not accept by > function CreateSignature(). I want to know if the BouncyCastle have any > function to get the My certificates, to return the certificate in right > type > to be used in CreateSignature(), or if have any way to convert > X509Certificate2 in a acceptable parameter to be passed in > CreateSignature(). > > Thanks All. > > Luiz Carlos Zancanella Junior > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- ----
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- > 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@(protected) > https://lists.sourceforge.net/lists/listinfo/itext-questions >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|
 |