SSLMate / go-pkcs12

Go library for encoding and decoding PKCS#12 files

Home Page:https://pkg.go.dev/software.sslmate.com/src/go-pkcs12

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

x509: RSA key missing NULL parameters

alimoli opened this issue · comments

I have a PKCS 12 file including:

  • one certificate
  • one private key

Screenshot 2021-03-01 at 17 56 13

What I simply do is:

  1. Read my p12 file
  2. Decode the p12 file
certFile, err := ioutil.ReadFile("authentication.p12")
privateKey, cert, err := pkcs12.Decode(certFile, "my_password")

The error returned from pkcs12 library is the following:
x509: RSA key missing NULL parameters

Is the problem related to the standard used by this library implementation?

Your certificate is not correctly encoded. Per RFC 3279 Section 2.3.1, RSA public keys are required to have a NULL parameter value. It would appear from this error message that the public key in your certificate is not compliant. You should report this as a bug with the software which produced this certificate.