I think it would be nice if an example of how to generate keys was added in the docs. I don't see any other people having issues so maybe I'm the only one that needs the documentation :)
But I keep getting errors like:
asn1: structure error: tags don't match (2 vs {class:0 tag:16 length:13 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} int @2
I'm creating keys with openssl like this:
openssl genrsa -out private_key.pem 4096
openssl rsa -pubout -in private_key.pem -out public_key.pem
The opening and closing tags of my private key looks like:
-----BEGIN RSA PRIVATE KEY-----
.....
-----END RSA PRIVATE KEY-----
I'm using go 1.15 and version v3.2.0 of this library
I was trying to use jwt.ParseRSAPrivateKeyFromPEM on the public key instead of the private key. Can't believe I spent so much time debugging this. Closing this issue.
I think it would be nice if an example of how to generate keys was added in the docs. I don't see any other people having issues so maybe I'm the only one that needs the documentation :)
But I keep getting errors like: asn1: structure error: tags don't match (2 vs {class:0 tag:16 length:13 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue: tag: stringType:0 timeType:0 set:false omitEmpty:false} int @2
I'm creating keys with openssl like this: openssl genrsa -out private_key.pem 4096 openssl rsa -pubout -in private_key.pem -out public_key.pem
The opening and closing tags of my private key looks like: -----BEGIN RSA PRIVATE KEY----- ..... -----END RSA PRIVATE KEY-----
I'm using go 1.15 and version v3.2.0 of this library
Thanks