esign icon indicating copy to clipboard operation
esign copied to clipboard

"create credential error: private key should be a PEM or plain PKSC1"

Open zmajew opened this issue 5 years ago • 2 comments

Thanks for the library. I am trying to run your examples_test.go ExampleJWTConfig() function and have an error:

create credential error: private key should be a PEM or plain PKSC1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false private:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2 exit status 1

zmajew avatar Feb 07 '20 09:02 zmajew

Same here, is this project dead ?

Z-a-r-a-k-i avatar May 07 '21 17:05 Z-a-r-a-k-i

Okay found out where the issue comes from: when you copy paste your RSA key into, make sure that you don't have any space in the start of each line or it will be detected as invalid.

Z-a-r-a-k-i avatar May 11 '21 10:05 Z-a-r-a-k-i