google / mundane

Mundane is a Rust cryptography library backed by BoringSSL that is difficult to misuse, ergonomic, and performant (in that order).
MIT License
1.07k stars 46 forks source link

Move public/private key marshaling and parsing into traits #9

Closed joshlf closed 5 years ago

joshlf commented 6 years ago

Currently, in the public module, marshaling and parsing of public and private keys is handled by bare functions which take DerPublicKey or DerPrivateKey trait bounds. The API evolved this way from an older version in which all public and private keys were assumed to be DER-encodable. Given the current API, it probably makes more sense to have parsing and marshaling be methods on those traits rather than bare functions.