#rsa-key #rsa #der #codec

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

#1241 in Cryptography

Download history 1061/week @ 2024-07-25 989/week @ 2024-08-01 1181/week @ 2024-08-08 936/week @ 2024-08-15 1074/week @ 2024-08-22 1306/week @ 2024-08-29 1251/week @ 2024-09-05 842/week @ 2024-09-12 971/week @ 2024-09-19 881/week @ 2024-09-26 684/week @ 2024-10-03 1385/week @ 2024-10-10 2283/week @ 2024-10-17 2144/week @ 2024-10-24 2372/week @ 2024-10-31 1889/week @ 2024-11-07

9,222 downloads per month
Used in fewer than 9 crates

MIT/Apache

10KB
114 lines

rsa-der

Documentation

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

See the documentation for examples.


lib.rs:

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

Dependencies

~1.4–2MB
~43K SLoC