6 stable releases

Uses old Rust 2015

4.0.0 Jun 1, 2018
1.0.4 Dec 18, 2017
1.0.3 Dec 14, 2017
1.0.1 Dec 8, 2017

#41 in #nom

Download history 20/week @ 2020-06-23 7/week @ 2020-06-30 63/week @ 2020-07-07 13/week @ 2020-07-14 2/week @ 2020-07-28 23/week @ 2020-08-11 14/week @ 2020-08-18 26/week @ 2020-08-25 21/week @ 2020-09-01 82/week @ 2020-09-08 29/week @ 2020-09-15 10/week @ 2020-09-22 16/week @ 2020-09-29 11/week @ 2020-10-06

100 downloads per month
Used in 2 crates (via osshkeys)

MIT license

21KB
521 lines

nom_pem

LICENSE Build Status Crates.io Version

Rust Crate implements PEM data encoding and parsing, which originated in Privacy Enhanced Mail. See RFC 1421 for details. It supports PEM messages with headers as well as without.

Based on nom as a parser combinator (https://github.com/Geal/nom).

  let b = b"-----BEGIN PRIVACY-ENHANCED MESSAGE-----
Proc-Type: 4,ENCRYPTED
Content-Domain: RFC822
DEK-Info: DES-CBC,F8143EDE5960C597
Originator-ID-Symmetric: linn@zendia.enet.dec.com,,
Recipient-ID-Symmetric: linn@zendia.enet.dec.com,ptf-kmc,3
Key-Info: DES-ECB,RSA-MD2,9FD3AAD2F2691B9A,
 B70665BB9BF7CBCDA60195DB94F727D3
Recipient-ID-Symmetric: pem-dev@tis.com,ptf-kmc,4
Key-Info: DES-ECB,RSA-MD2,161A3F75DC82EF26,
 E2EF532C65CBCFF79F83A2658132DB47

LLrHB0eJzyhP+/fSStdW8okeEnv47jxe7SJ/iN72ohNcUk2jHEUSoH1nvNSIWL9M
8tEjmF/zxB+bATMtPjCUWbz8Lr9wloXIkjHUlBLpvXR0UrUzYbkNpk0agV2IzUpk
J6UiRRGcDSvzrsoK+oNvqu6z7Xs5Xfz5rDqUcMlK1Z6720dcBWGGsDLpTpSCnpot
dXd/H5LMDWnonNvPCwQUHt==
-----END PRIVACY-ENHANCED MESSAGE-----";

let block = nom_pem::decode_block(b).unwrap();

assert_eq!(block.block_type, "PRIVACY-ENHANCED MESSAGE");
assert_eq!(block.data.len(), 160);

nom v4 compatible

Dependencies

~740KB
~14K SLoC