Signature

Trait Signature 

Source
pub trait Signature:
    Clone
    + Display
    + Debug
    + PartialEq
    + Eq
    + Hash {
    // Required methods
    fn from_base64(base64_string: &str) -> Result<Self, BaseConversionError>;
    fn to_bytes_vector(&self) -> Vec<u8> ;
    fn to_base64(&self) -> String;
}
Expand description

Define the operations that can be performed on a cryptographic signature.

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

A signature can be made with a PrivateKey and a message, and verified with the associated PublicKey.

Required Methods§

Source

fn from_base64(base64_string: &str) -> Result<Self, BaseConversionError>

Create a Signature from a Base64 string.

The Base64 string should contains only valid Base64 characters and have a correct length (64 bytes when converted). If it’s not the case, a BaseConvertionError is returned with the corresponding variant.

Source

fn to_bytes_vector(&self) -> Vec<u8>

Convert Signature into butes vector

Source

fn to_base64(&self) -> String

Encode the signature into Base64 string format.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§