Crate rsa_magic_public_key
source ·Expand description
Encode Rsa’s Public Key as a Magic Public Key
This implementation has been reverse-engineered from Mastodon’s implementation, since no documentation for the Magic Public Key format could be found online (Maybe I didn’t look hard enough).
Examples
From private key
use rsa_magic_public_key::AsMagicPublicKey;
let string = private_key.as_magic_public_key();
From public key
use rsa_magic_public_key::AsMagicPublicKey;
let string = public_key.as_magic_public_key();
Parsing
use rsa::RsaPublicKey;
use rsa_magic_public_key::FromMagicPublicKey;
let public_key = RsaPublicKey::from_magic_public_key(&magic_public_key).unwrap();
Enums
- Parsing errors
Traits
- Helper trait to add functionality to Rsa types
- Helper trait to add functionality to Rsa types