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 |
#11 in #pem
499 downloads per month
Used in 20 crates
(19 directly)
22KB
521 lines
nom_pem
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
~1MB
~17K SLoC