Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

signed fields invalid

843811Feb 11 2003 — edited Aug 31 2006
The following code (see below) produces a CertificateException. The detail message buffer reads, "signed fields invalid" error.

pkcs12Data is defined as, "byte [] pkcs12Data;" It holds a buffer that contains the server's private key and corresponding certificate in
"Personal Information Exchange Syntax" (PFX) format. The key and certificate are encrypted using an input password as specified by PKCS#12.

pkcs12Data is the ASN.1 DER encoded exported data.

Did I code this correctly? I'm not sure why I'm getting the "signed fields invalid" error. Any ideas?
-Paul

<<<<<<<<<<<<<<Codes snip>>>>>>>>>>>>>

CertificateFactory certFactory = CertificateFactory.getInstance("X509");
ByteArraypInputStream pkcs12InStream =
new ByteArrayInputStream(pkcs12Data);
try
{
Collection certCollection =
certFactory.generateCertificates(pkcs12Instream);
}
catch (CertificateException e)
{
String errMsg = "Error - certificateFactory.generateCertificates()!";
System.out.println(errMsg);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2006
Added on Feb 11 2003
2 comments
1,173 views