Struct signatory::Ed25519Seed [−][src]
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(
encoded_keypair: &[u8],
encoding: Encoding
) -> Result<Self, Error>
[src]
pub fn decode_keypair(
encoded_keypair: &[u8],
encoding: Encoding
) -> 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(encoded_seed: &[u8], encoding: Encoding) -> Result<Self, Error>
[src]
fn decode(encoded_seed: &[u8], encoding: Encoding) -> Result<Self, Error>
Decode an Ed25519 seed from a byte slice with the given encoding (e.g. hex, Base64)
fn decode_from_str<S: AsRef<str>>(
encoded: S,
encoding: Encoding
) -> Result<Self, Error>
[src]
fn decode_from_str<S: AsRef<str>>(
encoded: S,
encoding: Encoding
) -> Result<Self, Error>
Decode the given string-alike type with the provided Encoding
, returning the decoded value or a Error
. Read more
fn decode_from_reader<R: Read>(
reader: &mut R,
encoding: Encoding
) -> Result<Self, Error>
[src]
fn decode_from_reader<R: Read>(
reader: &mut R,
encoding: Encoding
) -> Result<Self, Error>
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: AsRef<Path>>(
path: P,
encoding: Encoding
) -> Result<Self, Error>
[src]
fn decode_from_file<P: AsRef<Path>>(
path: P,
encoding: Encoding
) -> Result<Self, Error>
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(&self, encoding: Encoding) -> Vec<u8>
[src]
fn encode(&self, encoding: Encoding) -> Vec<u8>
Encode an Ed25519 seed with the given encoding (e.g. hex, Base64)
fn encode_to_string<S: AsRef<str>>(&self, encoding: Encoding) -> String
[src]
fn encode_to_string<S: AsRef<str>>(&self, encoding: Encoding) -> String
Encode the given string-alike type with the provided Encoding
, returning the encoded value or a Error
. Read more
fn encode_to_writer<W: Write>(
&self,
writer: &mut W,
encoding: Encoding
) -> Result<usize, Error>
[src]
fn encode_to_writer<W: Write>(
&self,
writer: &mut W,
encoding: Encoding
) -> Result<usize, Error>
Encode the data read to the given io::Read
type with the provided Encoding
, returning the encoded value or a Error
. Read more
fn encode_to_file<P: AsRef<Path>>(
&self,
path: P,
encoding: Encoding
) -> Result<File, Error>
[src]
fn encode_to_file<P: AsRef<Path>>(
&self,
path: P,
encoding: Encoding
) -> Result<File, Error>
Read a file at the given path, decoding the data it contains using the provided Encoding
, returning the encoded value 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
Auto Trait Implementations
impl Send for Ed25519Seed
impl Send for Ed25519Seed
impl Sync for Ed25519Seed
impl Sync for Ed25519Seed