Crate duniter_keys [] [src]

Provide wrappers around public keys, private keys and signatures.

  • Keys can be converted to/from Base58 string format.
  • Signatures can be converted to/from Base64 string format.

Usage

use duniter_keys::{Signature, PublicKey, PrivateKey};
use duniter_keys::ed25519::KeyPairGenerator;

let generator = KeyPairGenerator::with_default_parameters();

let (private_key, public_key) = generator.generate(
    b"password",
    b"salt"
);

let message = "Hello, world!";

let signature = private_key.sign(&message.as_bytes());

assert!(public_key.verify(&message.as_bytes(), &signature));

Format

  • Base58 use the following alphabet : 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz
  • Base64 use the following alphabet : ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ with = as padding character.

Modules

ed25519

Provide wrappers around ed25519 keys and signatures

Enums

BaseConvertionError

Errors enumeration for Base58/64 strings convertion.

Traits

PrivateKey

Store a cryptographic private key.

PublicKey

Store a cryptographic public key.

Signature

Store a cryptographic signature.