[go-nuts] Re: PKCs8 generated using go has errors when doing a openssl check

2019-10-04 Thread rajesh nataraja
Sorry, I speed read your email, but you were right Piers. "PRIVATE KEY" as header makes the difference. Rajesh. On Friday, October 4, 2019 at 9:39:52 AM UTC-7, rajesh nataraja wrote: > > Hello Piers, > > I have tried your playground snippet and the snippet I gave here. Both > dont work, what

[go-nuts] Re: PKCs8 generated using go has errors when doing a openssl check

2019-10-04 Thread rajesh nataraja
Hello Piers, I have tried your playground snippet and the snippet I gave here. Both dont work, what I meant is saving the Marshalled key into a file and then using that to be processed by other applications (java, python, openssl command). This is with go 1.11.5, do you think there is some com

[go-nuts] Re: PKCs8 generated using go has errors when doing a openssl check

2019-10-04 Thread helloPiers
For PKCS8 (rather than PKCS1), use PEM type "PRIVATE KEY" (rather than "RSA PRIVATE KEY"). You may be constructing the ASN1 by hand deliberately, but just in case you didn't see it, there's also a standard library function x509.MarshalPKCS8PrivateKey() https://godoc.org/crypto/x509#MarshalPKCS