Trait crypto::signatures::ternary::PrivateKey[][src]

pub trait PrivateKey: Zeroize {
    type PublicKey: PublicKey;
    type Signature: Signature;
    type Error;
    fn generate_public_key(&self) -> Result<Self::PublicKey, Self::Error>;
fn sign(
        &mut self,
        message: &Trits<T1B1>
    ) -> Result<Self::Signature, Self::Error>;
fn from_trits(buf: TritBuf<T1B1Buf>) -> Result<Self, Self::Error>
    where
        Self: Sized
;
fn as_trits(&self) -> &Trits<T1B1>; }
This is supported on crate feature ternary_signatures only.

A ternary private key.

Associated Types

type PublicKey: PublicKey[src]

Matching public key type.

type Signature: Signature[src]

Generated signatures type.

type Error[src]

Errors occuring while handling private keys.

Loading content...

Required methods

fn generate_public_key(&self) -> Result<Self::PublicKey, Self::Error>[src]

Returns the public counterpart of a private key.

fn sign(
    &mut self,
    message: &Trits<T1B1>
) -> Result<Self::Signature, Self::Error>
[src]

Generates and returns a signature for a given message.

Arguments

  • message A slice that holds a message to be signed.

fn from_trits(buf: TritBuf<T1B1Buf>) -> Result<Self, Self::Error> where
    Self: Sized
[src]

Creates a private key from trits.

fn as_trits(&self) -> &Trits<T1B1>[src]

Interprets the private key as trits.

Loading content...

Implementors

impl<S: Sponge + Default> PrivateKey for WotsPrivateKey<S>[src]

This is supported on crate feature wots_deprecated_do_not_use only.

type PublicKey = WotsPublicKey<S>

type Signature = WotsSignature<S>

type Error = Error

Loading content...