You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to load a PKCS8 DSA key fails with the error:
ERROR: asn1.StructuralError{Msg:"tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 set:false omitEmpty:false} pkcs8 @2"}
An example of such a key is available at
https://raw.githubusercontent.com/pyca/cryptography/master/vectors/cryptography_vectors/asymmetric/PKCS8/unenc-dsa-pkcs8.pem
It can be successfully parsed by OpenSSL:
$ cat ./vectors/cryptography_vectors/asymmetric/PKCS8/unenc-dsa-pkcs8.pem | openssl
pkcs8 -nocrypt | openssl dsa -text -noout
read DSA key
Private-Key: (1024 bit)
priv:
00:a5:35:a8:e1:d0:d9:1b:ea:fc:8b:ee:1d:9b:2a:
3a:8d:e3:31:12:03
(continued)
OpenSSL's documentation claims that the specification for this can actually be found in
PKCS#11 (https://www.openssl.org/docs/apps/pkcs8.html#STANDARDS)
The text was updated successfully, but these errors were encountered:
Oops, that error message is wrong, it actually results in the (far more
errors.errorString{s:"x509: PKCS#8 wrapping contained private key with unknown algorithm: 1.2.840.10040.4.1"}
(the original is what happens if you pass the PEM contents in, rather than the DER).
by alex.gaynor:
The text was updated successfully, but these errors were encountered: