brycx / pasetors

PASETOrs: PASETO tokens in pure Rust
MIT License
87 stars 9 forks source link

Add `generate()` for `AsymmetricKeyPair` #45

Closed brycx closed 2 years ago

brycx commented 2 years ago

A user should be able to easily generate an asymmetric keypair for v2, v3 and v4.

This should be straight forward with v2 and v4 since the ed25519 crates support the needed operations as part of their public API. In terms of v3, this will probably require pulling in the pkcs8 because this is the only format ring supports the keypair to be exported as. We can get the public key from ring with .public_key().as_ref() but need PKCS8 parsing for the private key.

Based on discussion starting here: https://github.com/brycx/pasetors/issues/40#issuecomment-1098557241

brycx commented 2 years ago

Included in the 0.5.0-alpha.3 prerelease.