[][src]Struct signatory::ed25519::Seed

pub struct Seed(pub [u8; 32]);

Ed25519 seeds: derivation secrets for Ed25519 private scalars/nonce prefixes

Methods

impl Seed[src]

pub fn new(bytes: [u8; 32]) -> Self[src]

Create an Ed25519 seed from a 32-byte array

pub fn generate() -> Self[src]

Generate a new Ed25519 seed using the operating system's cryptographically secure random number generator

pub fn from_bytes<B>(bytes: B) -> Option<Self> where
    B: AsRef<[u8]>, 
[src]

Create an Ed25519 seed from a byte slice, returning KeyInvalid if the slice is not the correct size (32-bytes)

pub fn from_keypair(keypair: &[u8]) -> Option<Self>[src]

Create an Ed25519 seed from a keypair: i.e. a seed and its assocaited public key (i.e. compressed Edwards-y coordinate)

pub fn decode_keypair<E: Encoding>(
    encoded_keypair: &[u8],
    encoding: &E
) -> Result<Self, Error>
[src]

Decode a Seed from an encoded (hex or Base64) Ed25519 keypair

pub fn as_secret_slice(&self) -> &[u8][src]

Expose the secret values of the Seed as a byte slice

Trait Implementations

impl Decode for Seed[src]

fn decode<E: Encoding>(encoded_seed: &[u8], encoding: &E) -> Result<Self, Error>[src]

Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)

impl Encode for Seed[src]

fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>[src]

Encode an Ed25519 seed with the given encoding (e.g. hex, Base64)

impl From<[u8; 32]> for Seed[src]

impl Drop for Seed[src]

impl Clone for Seed[src]

Auto Trait Implementations

impl Unpin for Seed

impl Send for Seed

impl Sync for Seed

impl UnwindSafe for Seed

impl RefUnwindSafe for Seed

Blanket Implementations

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> Same<T> for T

type Output = T

Should always be Self