Skip to main content

SignaturePrivateKey

Trait SignaturePrivateKey 

Source
pub trait SignaturePrivateKey<const SK_LEN: usize>:
    PartialEq
    + Eq
    + Clone
    + Sized {
    // Required methods
    fn encode(&self) -> [u8; SK_LEN];
    fn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize;
    fn from_bytes(bytes: &[u8]) -> Result<Self, SignatureError>;
}
Expand description

A private key for a signature algorithm, often denoted “sk” (for “secret key”).

Required Methods§

Source

fn encode(&self) -> [u8; SK_LEN]

Write it out to bytes in its standard encoding.

Source

fn encode_out(&self, out: &mut [u8; SK_LEN]) -> usize

Write it out to bytes in its standard encoding. The entire output buffer is zeroized before the encoding is written.

Source

fn from_bytes(bytes: &[u8]) -> Result<Self, SignatureError>

Read it in from bytes in its standard encoding.

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§