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.
Currently, in the
public
module, marshaling and parsing of public and private keys is handled by bare functions which takeDerPublicKey
orDerPrivateKey
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.