I have obtained an SSL certificate for my domain from CAcert. From what I understand about SSL, it’s in PEM format and contains the certificate and the private key in one file. I previously imported another SSL cert into Openfire using a Java tool called ImportKey. From my old script, it requires two files that I called key.der and cert.der to import the key. I have those files for the other certificate, but not for this one and I don’t know where I got them years ago. I only have one PEM file. ImportKey cannot handle that file. I can convert the file to DER format with openssl, but that’s only one file, not two. If I enter that file twice in ImportKey, it also fails:
java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException : DER input, Integer tag error
Now how am I supposed to import that dumb certificate into Java? What is the official working way to get this simple task done? I mean, for Apache and tons of other apps, I just give them the file path to the file containing key and cert in PEM format and It Just Works™. Why is everything so complicated with Java? Can anybody help me out?