Openssl certificate error “signed fields invalid”

certificateopensslssl-certificatessl-certificate-errors

On Linux, we are running this command:

openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -config openssl.cnf -keyout mycompany.key -out mycompany.crt 

after posting this, I think the command we actually ran was probably this (but that puts the question into a different area, i.e. OpenAS2 instead of just certs and OpenSSL).

  cert import testcet /path/to/testcert.pfx passphrase

which results in this error:

org.openas2.WrappedException: java.security.cert.CertificateParsingException: signed fields invalid

I added a follow-up question specific to the "cert" command here:

OpenAS2 Cert Import gives error "Stream does not represent a PKCS12 key store"

The cert was created on Windows 2008/R2 in IIS, and exported as a .pfx file.
I couldn't find any other way to export it. I've seen other posts say that a .pfx is not a cert, but contains extra info that must be imported into a store.

I'm working on the Windows side, and my colleague is trying to import on the Linux side for AS2 communication with Microsoft BizTalk.

Best Answer

If I understand correctly, you currently have a PFX and are looking to import into a Linux machine. A PFX file is a Windows based file format for a password protected key and certificate bundle. It may also include the whole cert chain.

The openSSL command you should need is

openssl pkcs12 -in keyStore.pfx -out keyStore.pem -nodes

Give that a try and see if you get the same error.