Trait duniter_keys::PublicKey [] [src]

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

Store a cryptographic public key.

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

A PublicKey is used to verify the signature of a message with the associated PrivateKey.

Associated Types

Signature type of associated cryptosystem.

Required Methods

Create a PublicKey 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.

Verify a signature with this public key.

Implementors