Struct lamport_signature::PrivateKey [] [src]

pub struct PrivateKey<T> { /* fields omitted */ }

A one-time signing private key.

Methods

impl<T> PrivateKey<T>
[src]

[src]

Whether or not the PrivateKey was used.

impl<T> PrivateKey<T> where
    T: Digest
[src]

[src]

Constructs a PrivateKey with Digest algorithm type and the specified RNG.

[src]

Generates a PublicKey from the PrivateKey.

[src]

Signs the data.

Example

extern crate sha2;
extern crate rand;
extern crate lamport_signature;

use sha2::Sha256;
use rand::{XorShiftRng, SeedableRng};
use lamport_signature::PrivateKey;

const SEED: [u8; 16] = [0; 16];
let mut rng = XorShiftRng::from_seed(SEED);
let mut private_key = PrivateKey::<Sha256>::new(&mut rng);
const MESSAGE: &[u8] = b"hello, world!";
assert!(private_key.sign(MESSAGE).is_ok());

Trait Implementations

impl<T: Debug> Debug for PrivateKey<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Clone> Clone for PrivateKey<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Drop for PrivateKey<T>
[src]

[src]

Executes the destructor for this type. Read more

impl<T> PartialEq for PrivateKey<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<T> Eq for PrivateKey<T>
[src]

impl<T> PartialOrd for PrivateKey<T>
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T> Ord for PrivateKey<T>
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl<T> Hash for PrivateKey<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<T> Send for PrivateKey<T> where
    T: Send

impl<T> Sync for PrivateKey<T> where
    T: Sync