Trait duniter_keys::PrivateKey [] [src]

pub trait PrivateKey: Clone + Display + Debug + PartialEq + Eq + ToBase58 {
    type Signature: Signature;
    fn from_base58(base58_string: &str) -> Result<Self, BaseConvertionError>;
fn sign(&self, message: &[u8]) -> Self::Signature; }

Store a cryptographic private key.

A PrivateKey can be converted from/to Base58 format. When converted back and forth the value should be the same.

A PrivateKey is used to sign a message. The corresponding PublicKey will then be used to verify that signature.

Associated Types

Signature type of associated cryptosystem.

Required Methods

Create a PrivateKey from a Base58 string.

The Base58 string should contains only valid Base58 characters and have a correct length. If it's not the case, a BaseConvertionError is returned with the corresponding variant.

Sign a message with this private key.

Implementors