A pkcs7 doesn't have a private key.

Paulo

----- Original Message ----- 
From: "Felipe Gaúcho" <[EMAIL PROTECTED]>
To: "Post all your questions about iText here" 
<[email protected]>
Sent: Wednesday, August 01, 2007 10:59 AM
Subject: Re: [iText-questions] example using BouncyCastle


> trying the below code I can inspect the signature, everything seems fine.
>
> File pkcs7File = new File("mycacert.p7b");
> FileInputStream inputStream = new FileInputStream(pkcs7File);
> byte[] bytes = new byte[inputStream.available()];
> inputStream.read(bytes);
> sun.security.pkcs.PKCS7.PKCS7 pk = new PKCS7(bytes);
> java.security.cert.X509Certificate.X509Certificate[] chain =
> pk.getCertificates();
>
> problem: in the method setCrypto of the signature appearance, I need
>
> java.security.PrivateKey
> java.security.cert.Certificate[]
>
> how to convert:
>
> BouncyCastle
>     Java API
> sun.security.pkcs.PKCS7.PKCS7                         -->>
> java.security.PrivateKey
> java.security.cert.X509Certificate.X509Certificate[]   -->>
> java.security.cert.Certificate[]
>
> or how to use bouncy with iText ?


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to