[−][src]Struct signatory::EcdsaSecretKey
Raw ECDSA secret keys: raw scalar value WeierstrassCurve::ScalarBytes
in size used as the x
value for ECDSA.
Methods
impl<C> SecretKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
pub fn new<B>(into_bytes: B) -> Self where
B: Into<GenericArray<u8, C::ScalarSize>>,
[src]
B: Into<GenericArray<u8, C::ScalarSize>>,
Create a raw ECDSA secret key
pub fn from_bytes<B: AsRef<[u8]>>(bytes: B) -> Result<Self, Error>
[src]
Decode a raw ECDSA secret key from the given byte slice
pub fn generate() -> Self
[src]
Generate a new ECDSA secret key using the operating system's cryptographically secure random number generator
pub fn generate_from_rng<R>(csprng: &mut R) -> Self where
R: CryptoRng + RngCore,
[src]
R: CryptoRng + RngCore,
Generate a new ECDSA secret key using the provided random number generator
pub fn as_secret_slice(&self) -> &[u8]
[src]
Expose this SecretKey
as a byte slice
Trait Implementations
impl<C> Decode for SecretKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn decode<E: Encoding>(encoded_key: &[u8], encoding: &E) -> Result<Self, Error>
[src]
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]
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]
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]
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<C> Encode for SecretKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
fn encode<E: Encoding>(&self, encoding: &E) -> Vec<u8>
[src]
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]
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]
&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]
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<C: WeierstrassCurve> Clone for SecretKey<C>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C> Drop for SecretKey<C> where
C: WeierstrassCurve,
[src]
C: WeierstrassCurve,
Auto Trait Implementations
impl<C> Send for EcdsaSecretKey<C> where
<C as WeierstrassCurve>::ScalarSize: ArrayLength<u8>,
<C as WeierstrassCurve>::ScalarSize: ArrayLength<u8>,
impl<C> Sync for EcdsaSecretKey<C> where
<C as WeierstrassCurve>::ScalarSize: ArrayLength<u8>,
<C as WeierstrassCurve>::ScalarSize: ArrayLength<u8>,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
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]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> Same for T
type Output = T
Should always be Self