Created
June 25, 2015 15:05
-
-
Save j16r/ac274feb99780bac85f5 to your computer and use it in GitHub Desktop.
Golang and ParseECPrivateKey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# According to the go src (https://github.com/golang/go/blob/master/src/crypto/x509/sec1_test.go) | |
# this is how to use openssl to generate an EC private key. Go can't read it | |
# however. | |
# openssl ecparam -name secp521r1 -genkey -param_enc explicit -outform PEM -out $@ | |
# e.g: | |
got asn1: structure error: tags don't match (6 vs {class:0 tag:16 length:450 isCompound:true}) {optional:false ex | |
plicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 set:false omitEmpty:false} ObjectIdentifier @4 | |
# For debugging the private key | |
# openssl ecparam -in $@ -text -noout | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am having a similar problem, certificates generated with Go can be parsed by openssl but not by Go's x509.ParseCertificate func.
Did you find a solution ?