On 2020-04-20 13:03, Pooja Lakkundi wrote:
> (btw openssl version reports "OpenSSL 1.0.1f 6 Jan 2014"). But trying to use
> this key with
> x509.ParsePKCS1PrivateKey()
> fails with following error:
> 
> asn1: structure error: tags don't match (2 vs {class:0 tag:16 length:13
> isCompound:true}) {optional:false explicit:false application:false
> defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false 
> omitEmpty:false}  @5

Not sure this will help but I found LibreSSL is much faster than stdlib
rsa.GenerateKey.

When I use openssl genrsa

I find x509.ParsePKCS1PrivateKey works fine.

Did you run it through pem.Decode first and hand the output.bytes to
x509.ParsePKCS1PrivateKey?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8b4bd0e8-d577-ee8f-157d-ad972d6714ba%40gmail.com.

Reply via email to