pub struct SigningKey<P: ParameterSet> { /* private fields */ }Expand description
A SigningKey allows signing messages with a fixed parameter set
Implementations§
Source§impl<P: ParameterSet> SigningKey<P>
impl<P: ParameterSet> SigningKey<P>
Sourcepub fn new(rng: &mut impl CryptoRngCore) -> Self
pub fn new(rng: &mut impl CryptoRngCore) -> Self
Create a new SigningKey from a cryptographic random number generator
Sourcepub fn try_sign_with_context(
&self,
msg: &[u8],
ctx: &[u8],
opt_rand: Option<&[u8]>,
) -> Result<Signature<P>, Error>
pub fn try_sign_with_context( &self, msg: &[u8], ctx: &[u8], opt_rand: Option<&[u8]>, ) -> Result<Signature<P>, Error>
Implements [slh-sign] as defined in FIPS-205, using a context string. Context strings must be 255 bytes or less.
§Errors
Returns an error if the context string is too long.
Trait Implementations§
Source§impl<P: ParameterSet> AsRef<VerifyingKey<P>> for SigningKey<P>
impl<P: ParameterSet> AsRef<VerifyingKey<P>> for SigningKey<P>
Source§fn as_ref(&self) -> &VerifyingKey<P>
fn as_ref(&self) -> &VerifyingKey<P>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<P: Clone + ParameterSet> Clone for SigningKey<P>where
P::N: Clone,
impl<P: Clone + ParameterSet> Clone for SigningKey<P>where
P::N: Clone,
Source§fn clone(&self) -> SigningKey<P>
fn clone(&self) -> SigningKey<P>
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<P: Debug + ParameterSet> Debug for SigningKey<P>where
P::N: Debug,
impl<P: Debug + ParameterSet> Debug for SigningKey<P>where
P::N: Debug,
Source§impl<P: ParameterSet> KeypairRef for SigningKey<P>
impl<P: ParameterSet> KeypairRef for SigningKey<P>
Source§type VerifyingKey = VerifyingKey<P>
type VerifyingKey = VerifyingKey<P>
Verifying key type for this keypair.
Source§impl<P: PartialEq + ParameterSet> PartialEq for SigningKey<P>where
P::N: PartialEq,
impl<P: PartialEq + ParameterSet> PartialEq for SigningKey<P>where
P::N: PartialEq,
Source§impl<P: ParameterSet> RandomizedSigner<Signature<P>> for SigningKey<P>
impl<P: ParameterSet> RandomizedSigner<Signature<P>> for SigningKey<P>
Source§fn try_sign_with_rng(
&self,
rng: &mut impl CryptoRngCore,
msg: &[u8],
) -> Result<Signature<P>, Error>
fn try_sign_with_rng( &self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<Signature<P>, Error>
Attempt to sign the given message, returning a digital signature on
success, or an error if something went wrong. Read more
Source§fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message and return a digital signature
Source§impl<P: ParameterSet> Signer<Signature<P>> for SigningKey<P>
impl<P: ParameterSet> Signer<Signature<P>> for SigningKey<P>
Source§impl<P: ParameterSet> TryFrom<&[u8]> for SigningKey<P>
impl<P: ParameterSet> TryFrom<&[u8]> for SigningKey<P>
impl<P: Eq + ParameterSet> Eq for SigningKey<P>where
P::N: Eq,
impl<P: ParameterSet> StructuralPartialEq for SigningKey<P>
Auto Trait Implementations§
impl<P> Freeze for SigningKey<P>
impl<P> RefUnwindSafe for SigningKey<P>
impl<P> Send for SigningKey<P>
impl<P> Sync for SigningKey<P>
impl<P> Unpin for SigningKey<P>
impl<P> UnwindSafe for SigningKey<P>
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,
Source§impl<K> Keypair for Kwhere
K: KeypairRef,
impl<K> Keypair for Kwhere
K: KeypairRef,
Source§type VerifyingKey = <K as KeypairRef>::VerifyingKey
type VerifyingKey = <K as KeypairRef>::VerifyingKey
Verifying key type for this keypair.
Source§fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
fn verifying_key(&self) -> <K as Keypair>::VerifyingKey
Get the verifying key which can verify signatures produced by the
signing key portion of this keypair.
Source§impl<S, T> RandomizedSignerMut<S> for Twhere
T: RandomizedSigner<S>,
impl<S, T> RandomizedSignerMut<S> for Twhere
T: RandomizedSigner<S>,
Source§fn try_sign_with_rng(
&mut self,
rng: &mut impl CryptoRngCore,
msg: &[u8],
) -> Result<S, Error>
fn try_sign_with_rng( &mut self, rng: &mut impl CryptoRngCore, msg: &[u8], ) -> Result<S, Error>
Attempt to sign the given message, updating the state, and returning a
digital signature on success, or an error if something went wrong. Read more
Source§fn sign_with_rng(&mut self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&mut self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message, update the state, and return a digital signature.