This is a created article in which the information may have evolved or changed.
Golang does not support P12 parsing, so it needs to be converted to PEM
There are some, but not automatic conversions (non-interactive mode). The following conversions are non-interactive modes:
Generate temporary files Cert.pem, note passin and passout options
OpenSSL pkcs12-clcerts-nokeys-out cert.pem-in cert.p12-passin Pass:p12_pass
Generate Temporary Files Key.pem
OpenSSL pkcs12-nocerts-out key.pem-in cert.p12-passin pass:p12_pass-passout pass:tmp_pass
Remove the KEY.PEM password
OpenSSL rsa-in key.pem-out key.unencrypted.pem-passin Pass:tmp_pass
Generate Cert files that build Golang can process
Cert, Err: = TLS. Loadx509keypair (CERT.PEM, KEY.UNENCRYPTED.PEM)
This generates a certificate that Golang can handle.
Note:
P12_pass: password when generating the P12 file
Tmp_pass: The exported temporary password must be greater than or equal to 4 characters