Crate rsa_der

Source
Expand description

A simple crate to encode and decode DER-formatted public RSA keys.

Public keys are passed to and returned from functions simply using the n and e components, so any RSA library can be used in conjunction with this crate.

§Examples

Convert an RSA public key to DER bytes:

use rand::rngs::OsRng;

let key = generate_key();
let der_bytes = rsa_der::public_key_to_der(&key.n().to_bytes_be(), &key.e().to_bytes_be());

Enums§

  • Error type for rsa-der.

Functions§

Type Aliases§

  • Result type for rsa-der. This type is equivalent to std::result::Result<T, rsa_der::Error>.