Expand description
Pure-Rust S-expression parser and serializer for OpenPGP key formats.
A faithful port of librnp’s sexpp C++ library. Supports canonical,
advanced, and base64 printing modes plus the GnuPG 2.3+ extended private key
format.
use rnp_sexp::Sexp;
let input = "(8:test-key (1:a 3:bcd))";
let sexp = Sexp::parse_advanced(input).unwrap();
println!("{}", sexp.to_advanced());Re-exports§
Modules§
- error
- Error type and reporting infrastructure. Port of sexp-error.cpp.
Structs§
- ExtKey
Input Stream - Wraps the byte slice with continuation-line awareness required by the
extended key format. The C++ implementation maintains an
is_scanning_valueflag that toggles continuation handling; this wrapper exposes it viaSelf::set_scanning_value. - Extended
Private Key - Sexp
Input Stream - Sexp
List - An S-expression list:
(elem1 elem2 ...). - Sexp
Output Stream - Sexp
String - An S-expression string: raw bytes with an optional presentation hint.
- Slice
Source
Enums§
Traits§
- Char
Source - Source of bytes for the parser. The C++ implementation uses virtual
dispatch (
ext_key_input_stream_t::read_charoverrides the base); we use a trait, withSliceSourceas the default for raw byte slices.
Functions§
- parse_
advanced - parse_
canonical - parse_
extended - Convenience: parse
inputas an extended private key.