[][src]Struct exonum_crypto::SecretKey

pub struct SecretKey(_);

Ed25519 secret key used to create digital signatures over messages.

In public-key cryptography, the system uses a a mathematically related pair of keys: a public key, which is openly distributed, and a secret key, which should remain confidential. For more information, refer to Public-key cryptography.

Ed25519 is a signature system that ensures fast signing and key generation, as well as security and collision resilience.

Examples

In the example below, the function generates a pair of random public and secret keys.


let (_, secret_key) = exonum_crypto::gen_keypair();

Methods

impl SecretKey[src]

pub fn zero() -> Self[src]

Creates a new instance filled with zeros.

impl SecretKey[src]

pub fn new(bytes_array: [u8; 64]) -> Self[src]

Creates a new instance from bytes array.

pub fn from_slice(bytes_slice: &[u8]) -> Option<Self>[src]

Creates a new instance from bytes slice.

pub fn to_hex(&self) -> String[src]

Returns a hex representation of binary data. Lower case letters are used (e.g. f9b4ca).

Trait Implementations

impl PartialEq<SecretKey> for SecretKey[src]

impl Clone for SecretKey[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for SecretKey[src]

impl Debug for SecretKey[src]

impl Index<Range<usize>> for SecretKey[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeTo<usize>> for SecretKey[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFrom<usize>> for SecretKey[src]

type Output = [u8]

The returned type after indexing.

impl Index<RangeFull> for SecretKey[src]

type Output = [u8]

The returned type after indexing.

impl Serialize for SecretKey[src]

impl<'de> Deserialize<'de> for SecretKey[src]

impl ToHex for SecretKey[src]

impl FromHex for SecretKey[src]

type Error = FromHexError

Auto Trait Implementations

impl Send for SecretKey

impl Sync for SecretKey

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]