Certificate chain

View: New views
3 Messages — Rating Filter:   Alert me  

Certificate chain

by KrazySmile :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey everyone.

In the examples provided in http://itextpdf.sourceforge.net/howtosign.html there is:
Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser();
Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(this._cert.RawData) };

after this, chain, only have the certificate itself, instead of the whole certificate chain.

now, in pkcs12 pfx files, i do know how to get it (by using Pkcs12Store), but as for smartcards, how can i get the chain ? is it possible ?

Regards.

Re: Certificate chain

by KrazySmile :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well after a little bit more of search i found:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509chain.aspx

Maybe use X509Chain class to get the
System.Security.Cryptography.X509Certificates.X509Certificate2
chain and then convert them to
Org.BouncyCastle.X509.X509Certificate

is this a valid solution?
What other way can i use? Is there anything similar in Org.BouncyCastle ?



Regards.



KrazySmile wrote:
Hey everyone.

In the examples provided in http://itextpdf.sourceforge.net/howtosign.html there is:
Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser();
Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(this._cert.RawData) };

after this, chain, only have the certificate itself, instead of the whole certificate chain.

now, in pkcs12 pfx files, i do know how to get it (by using Pkcs12Store), but as for smartcards, how can i get the chain ? is it possible ?

Regards.

Re: Certificate chain

by KrazySmile :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

im having some troubles getting this to work correctly.

i make:
this._sap.SetCrypto(null, chain, null, null);
and in chain im sure there is a certificate chain, made of 3 certificates.
and signing went fine.

now when i reopen the pdf, and "read" the signatures:
...
PdfPKCS7 pk = af.VerifySignature(name);
Org.BouncyCastle.X509.X509Certificate[] pkc = pk.Certificates;

pkc, only has 1 certificate, when it was suposed to have the whole chain (i gess)...

Is there a reason why this is happening ? or am i thinking wrong.

Really appreciate some input on this one. thanks.

Regards.





Well after a little bit more of search i found:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509chain.aspx

Maybe use X509Chain class to get the
System.Security.Cryptography.X509Certificates.X509Certificate2
chain and then convert them to
Org.BouncyCastle.X509.X509Certificate

is this a valid solution?
What other way can i use? Is there anything similar in Org.BouncyCastle ?



Regards.



KrazySmile wrote:
Hey everyone.

In the examples provided in http://itextpdf.sourceforge.net/howtosign.html there is:
Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser();
Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(this._cert.RawData) };

after this, chain, only have the certificate itself, instead of the whole certificate chain.

now, in pkcs12 pfx files, i do know how to get it (by using Pkcs12Store), but as for smartcards, how can i get the chain ? is it possible ?

Regards.

LightInTheBox - Buy quality products at wholesale price