CryptoUtil

This commit is contained in:
Alex Emmet 2026-07-03 16:43:29 +02:00
commit 912aa9491c
10 changed files with 153 additions and 35 deletions

View file

@ -0,0 +1,7 @@
[package]
name = "keygen"
version = "0.1.0"
edition = "2024"
[dependencies]
mtp = { version = "0.1.0", path = "../../", features = ["crypto"] }

View file

@ -0,0 +1,13 @@
use mtp::crypto::Keyring;
fn main() {
let keyring = Keyring::generate();
let bundle = keyring.public_key_bundle();
// The `Debug` impl redacts private keys by design, so use the encoding
// methods to emit the full keyring (public + secret keys) instead.
println!("Keyring (hex):\n{}\n", keyring.to_hex());
println!("Keyring (base64):\n{}\n", keyring.to_base64());
println!("PublicKeyBundle (base64):\n{}", bundle.to_base64());
}