Closed romgrm closed 1 year ago
@romgrm As far as I can see, the RFC of PKCS8 should allow EC private key to be encoded in the pkcs8 format. But this library does not support it at the moment. It only supports RSA keys to be encoded in PKCS8.
Therefore I can provide you some solutions :
I keep this issue open to close it once the feature is added.
@Ephenodrom thanks for the answer. I try to push a PR as quickly as possible with the conversion code :)
PR is already merged and live on pub.dev
Hello !
Firstly thanks for your lib, it's really helpful !
I'm currently generating an EC keypair that I encode in PEM format.
The back end to which I send the keys tells me that they need the Pkcs8 format and not SEC1.
I've tried to do this but I get a type error during conversion : [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: type 'ASN1OctetString' is not a subtype of type 'ASN1Sequence' in type cast
The code :
I wonder if it's possible to convert an ECPrivateKey to Pcks8? Or is it only for RSA keys?
I'm not very comfortable with all this, so I may be talking nonsense.
Thanks :)