[−][src]Struct signatory::ed25519::Seed
Ed25519 seeds: derivation secrets for Ed25519 private scalars/nonce prefixes
Methods
impl Seed
[src]
impl Seed
pub fn new(bytes: [u8; 32]) -> Self
[src]
pub fn new(bytes: [u8; 32]) -> Self
Create an Ed25519 seed from a 32-byte array
pub fn generate() -> Self
[src]
pub fn generate() -> Self
Generate a new Ed25519 seed using the operating system's cryptographically secure random number generator
pub fn generate_from_rng<R: CryptoRng + RngCore>(csprng: &mut R) -> Self
[src]
pub fn generate_from_rng<R: CryptoRng + RngCore>(csprng: &mut R) -> Self
Generate a new Ed25519 seed using the provided random number generator
pub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
B: AsRef<[u8]>,
[src]
pub fn from_bytes<B>(bytes: B) -> Result<Self, Error> where
B: AsRef<[u8]>,
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]) -> Result<Self, Error>
[src]
pub fn from_keypair(keypair: &[u8]) -> Result<Self, Error>
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]
pub fn decode_keypair<E: Encoding>(
encoded_keypair: &[u8],
encoding: &E
) -> Result<Self, Error>
Decode a Seed
from an encoded (hex or Base64) Ed25519 keypair
pub fn as_secret_slice(&self) -> &[u8]
[src]
pub fn as_secret_slice(&self) -> &[u8]
Expose the secret values of the Seed
as a byte slice
Trait Implementations
impl Decode for Seed
[src]
impl Decode for Seed
fn decode<E: Encoding>(encoded_seed: &[u8], encoding: &E) -> Result<Self, Error>
[src]
fn decode<E: Encoding>(encoded_seed: &[u8], encoding: &E) -> Result<Self, Error>
Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
[src]
fn decode_from_str<S, E>(encoded_str: S, encoding: &E) -> Result<Self, Error> where
S: AsRef<str>,
E: Encoding,
Decode the given string-alike type with the provided Encoding
, returning the decoded value or a Error
. Read more
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
[src]
fn decode_from_reader<R, E>(reader: &mut R, encoding: &E) -> Result<Self, Error> where
R: Read,
E: Encoding,
Decode the data read from the given io::Read
type with the provided Encoding
, returning the decoded value or a Error
. Read more
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
fn decode_from_file<P, E>(path: P, encoding: &E) -> Result<Self, Error> where
P: AsRef<Path>,
E: Encoding,
Read a file at the given path, decoding the data it contains using the provided Encoding
, returning the decoded value or a Error
. Read more
impl Encode for Seed
[src]
impl Encode for Seed
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
[src]
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
Encode an Ed25519 seed with the given encoding (e.g. hex, Base64)
fn encode_to_string<E: Encoding>(&self, encoding: &E) -> Result<String, Error>
[src]
fn encode_to_string<E: Encoding>(&self, encoding: &E) -> Result<String, Error>
Encode self
to a String
using the provided Encoding
, returning the encoded value or a Error
. Read more
fn encode_to_writer<W, E>(
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
[src]
fn encode_to_writer<W, E>(
&self,
writer: &mut W,
encoding: &E
) -> Result<usize, Error> where
W: Write,
E: Encoding,
Encode self
with the given Encoding
, writing the result to the supplied io::Write
type, returning the number of bytes written or a Error
. Read more
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
[src]
fn encode_to_file<P, E>(&self, path: P, encoding: &E) -> Result<File, Error> where
P: AsRef<Path>,
E: Encoding,
Encode self
and write it to a file at the given path, returning the resulting File
or a Error
. Read more
impl Drop for Seed
[src]
impl Drop for Seed
impl From<[u8; 32]> for Seed
[src]
impl From<[u8; 32]> for Seed
impl Clone for Seed
[src]
impl Clone for Seed
Auto Trait Implementations
impl Send for Ed25519Seed
impl Send for Ed25519Seed
impl Sync for Ed25519Seed
impl Sync for Ed25519Seed
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self