A library for working with BIP329 labels.
- The main data structure is the Labelsstruct, which is a list ofLabelstructs.
- The Labelenum containing all the different types of labels.
- The Labelsstruct can be imported/exported to/from a JSONL file.
- Supports encryption and decryption using the encryptionmodule.
- Supports the uniffifeature, for easy integration with other languages.
use bip329::Labels;
let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap();use bip329::Labels;
// Create a Labels struct
let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap();
// Create a JSONL string
let jsonl = labels.export().unwrap();use bip329::{Labels, encryption::EncryptedLabels};
let labels = Labels::try_from_file("tests/data/labels.jsonl").unwrap();
let encrypted = EncryptedLabels::encrypt(&labels, "passphrase").unwrap();
let encrypted = EncryptedLabels::read_from_file("tests/data/encrypted_labels.age").unwrap();
let decrypted = encrypted.decrypt("passphrase").unwrap();
assert_eq!(labels, decrypted);