sfackler / rust-native-tls

Apache License 2.0
474 stars 199 forks source link

Support for elliptic private keys possible? #221

Closed DerAndereAndi closed 2 years ago

DerAndereAndi commented 2 years ago

HI everyone,

when using an identity pkcs8 key that uses an elliptic private key with the 1st line string

-----BEGIN EC PRIVATE KEY-----

instead of

-----BEGIN PRIVATE KEY-----

then the library can't work with it. When modifying the 1st line to the later it works. Would it be possible to support this out of the box without requiring to modify this line?

That would be awesome. Thanks for the library and all the work it involves! Andreas

sfackler commented 2 years ago

I believe that is SEC 1 formatted rather than PKCS#8. This SO post talks about the difference and how to convert between them: https://security.stackexchange.com/a/84331

DerAndereAndi commented 2 years ago

Very good point. Thank you!