signed fields invalid
843811Feb 11 2003 — edited Aug 31 2006The 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);
}