pub struct SigningKey<D: Domain> { /* private fields */ }Expand description
A decaf377-rdsa signing key.
Implementations§
Source§impl<D: Domain> SigningKey<D>
impl<D: Domain> SigningKey<D>
Source§impl SigningKey<SpendAuth>
impl SigningKey<SpendAuth>
Sourcepub fn randomize(&self, randomizer: &Fr) -> SigningKey<SpendAuth>
pub fn randomize(&self, randomizer: &Fr) -> SigningKey<SpendAuth>
Randomize this public key with the given randomizer.
Source§impl<D: Domain> SigningKey<D>
impl<D: Domain> SigningKey<D>
Sourcepub fn new<R: RngCore + CryptoRng>(rng: R) -> SigningKey<D>
pub fn new<R: RngCore + CryptoRng>(rng: R) -> SigningKey<D>
Create a new signing key from the supplied rng.
Sourcepub fn new_from_field(sk: Fr) -> SigningKey<D>
pub fn new_from_field(sk: Fr) -> SigningKey<D>
Use the supplied field element as the signing key directly.
§Warning
This function exists to allow custom key derivation; it’s the caller’s responsibility to ensure that the input was generated securely.
Sourcepub fn sign<R: RngCore + CryptoRng>(&self, rng: R, msg: &[u8]) -> Signature<D>
pub fn sign<R: RngCore + CryptoRng>(&self, rng: R, msg: &[u8]) -> Signature<D>
Create a signature for domain D on msg using this SigningKey.
Sourcepub fn sign_deterministic(&self, msg: &[u8]) -> Signature<D>
pub fn sign_deterministic(&self, msg: &[u8]) -> Signature<D>
Create a signature for domain D on msg using this SigningKey.
Prefer sign, unless you know you need deterministic signatures.
Trait Implementations§
Source§impl<D: Clone + Domain> Clone for SigningKey<D>
impl<D: Clone + Domain> Clone for SigningKey<D>
Source§fn clone(&self) -> SigningKey<D>
fn clone(&self) -> SigningKey<D>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SigningKey<Binding>
impl Debug for SigningKey<Binding>
Source§impl Debug for SigningKey<SpendAuth>
impl Debug for SigningKey<SpendAuth>
Source§impl<'de, D> Deserialize<'de> for SigningKey<D>where
D: Domain,
impl<'de, D> Deserialize<'de> for SigningKey<D>where
D: Domain,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a, D: Domain> From<&'a SigningKey<D>> for VerificationKey<D>
impl<'a, D: Domain> From<&'a SigningKey<D>> for VerificationKey<D>
Source§fn from(sk: &'a SigningKey<D>) -> VerificationKey<D>
fn from(sk: &'a SigningKey<D>) -> VerificationKey<D>
Converts to this type from the input type.
Source§impl<D: Domain> From<Fr> for SigningKey<D>
impl<D: Domain> From<Fr> for SigningKey<D>
Source§impl<'a, D: Domain> From<SigningKey<D>> for VerificationKey<D>
impl<'a, D: Domain> From<SigningKey<D>> for VerificationKey<D>
Source§fn from(sk: SigningKey<D>) -> VerificationKey<D>
fn from(sk: SigningKey<D>) -> VerificationKey<D>
Converts to this type from the input type.
Source§impl<D> Serialize for SigningKey<D>where
D: Domain,
impl<D> Serialize for SigningKey<D>where
D: Domain,
impl<D: Copy + Domain> Copy for SigningKey<D>
Auto Trait Implementations§
impl<D> Freeze for SigningKey<D>
impl<D> RefUnwindSafe for SigningKey<D>where
D: RefUnwindSafe,
impl<D> Send for SigningKey<D>where
D: Send,
impl<D> Sync for SigningKey<D>where
D: Sync,
impl<D> Unpin for SigningKey<D>where
D: Unpin,
impl<D> UnwindSafe for SigningKey<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more