#der

rsa-der

Crate to encode and decode public RSA keys using DER

5 unstable releases

0.3.0 Nov 7, 2021
0.2.1 Aug 11, 2019
0.2.0 Aug 11, 2019
0.1.1 Aug 9, 2019
0.1.0 Aug 9, 2019

#51 in #der

Download history 763/week @ 2026-01-12 668/week @ 2026-01-19 662/week @ 2026-01-26 707/week @ 2026-02-02 382/week @ 2026-02-09 659/week @ 2026-02-16 1282/week @ 2026-02-23 1860/week @ 2026-03-02 1149/week @ 2026-03-09 735/week @ 2026-03-16 781/week @ 2026-03-23 804/week @ 2026-03-30 841/week @ 2026-04-06 688/week @ 2026-04-13 516/week @ 2026-04-20 473/week @ 2026-04-27

2,696 downloads per month
Used in 10 crates

MIT/Apache

10KB
114 lines

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());

rsa-der

Documentation

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

See the documentation for examples.

Dependencies

~1.4–2MB
~42K SLoC