pub struct SigningKey {
pub(crate) secret: ExpandedSecretKey,
}Expand description
Signing key for Ed448
Fields§
§secret: ExpandedSecretKeyImplementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn to_bytes(&self) -> SecretKey
pub fn to_bytes(&self) -> SecretKey
Serialize this SigningKey as bytes.
Sourcepub fn as_bytes(&self) -> &SecretKey
pub fn as_bytes(&self) -> &SecretKey
Serialize this SigningKey as a byte reference.
Sourcepub fn to_scalar(&self) -> EdwardsScalar
pub fn to_scalar(&self) -> EdwardsScalar
Return the clamped EdwardsScalar for this SigningKey.
This is the scalar that is actually used for signing. Be warned, this is secret material that should be handled with care.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Get the VerifyingKey for this SigningKey.
Sourcepub fn with_context<'k, 'v>(
&'k self,
context: &'v [u8],
) -> Context<'k, 'v, Self>
pub fn with_context<'k, 'v>( &'k self, context: &'v [u8], ) -> Context<'k, 'v, Self>
Create a signing context that can be used for Ed448ph with
signature::DigestSigner
Sourcepub fn sign_raw(&self, message: &[u8]) -> Signature
pub fn sign_raw(&self, message: &[u8]) -> Signature
Sign a message with this SigningKey using the Ed448 algorithm
defined in RFC8032 §5.2.
Sourcepub fn sign_ctx(
&self,
context: &[u8],
message: &[u8],
) -> Result<Signature, Error>
pub fn sign_ctx( &self, context: &[u8], message: &[u8], ) -> Result<Signature, Error>
Sign a message in the given context with this SigningKey using the Ed448ph algorithm
defined in RFC8032 §5.2.
Sourcepub fn sign_prehashed<D>(
&self,
context: Option<&[u8]>,
prehashed_message: D,
) -> Result<Signature, Error>where
D: PreHash,
pub fn sign_prehashed<D>(
&self,
context: Option<&[u8]>,
prehashed_message: D,
) -> Result<Signature, Error>where
D: PreHash,
Sign a prehashed_message with this SigningKey using the
Ed448ph algorithm defined in RFC8032 §5.2.
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a duplicate 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 ConstantTimeEq for SigningKey
impl ConstantTimeEq for SigningKey
Source§impl Debug for SigningKey
impl Debug for SigningKey
Source§impl<D> DigestSigner<D, Signature> for SigningKey
impl<D> DigestSigner<D, Signature> for SigningKey
Source§impl<D> DigestVerifier<D, Signature> for SigningKey
impl<D> DigestVerifier<D, Signature> for SigningKey
Source§impl Drop for SigningKey
impl Drop for SigningKey
Source§impl DynSignatureAlgorithmIdentifier for SigningKey
Available on crate features alloc and pkcs8 only.
impl DynSignatureAlgorithmIdentifier for SigningKey
Available on crate features
alloc and pkcs8 only.Source§fn signature_algorithm_identifier(&self) -> Result<AlgorithmIdentifierOwned>
fn signature_algorithm_identifier(&self) -> Result<AlgorithmIdentifierOwned>
AlgorithmIdentifier for the corresponding signature system. Read moreSource§impl EncodePrivateKey for SigningKey
Available on crate features alloc and pkcs8 only.
impl EncodePrivateKey for SigningKey
Available on crate features
alloc and pkcs8 only.Source§fn to_pkcs8_der(&self) -> Result<SecretDocument>
fn to_pkcs8_der(&self) -> Result<SecretDocument>
Serialize a
SecretDocument containing a PKCS#8-encoded private key. Read moreSource§fn to_pkcs8_pem(
&self,
line_ending: LineEnding,
) -> Result<Zeroizing<String>, Error>
fn to_pkcs8_pem( &self, line_ending: LineEnding, ) -> Result<Zeroizing<String>, Error>
Serialize this private key as PEM-encoded PKCS#8 with the given
LineEnding. Read moreSource§fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
fn write_pkcs8_der_file(&self, path: impl AsRef<Path>) -> Result<(), Error>
Write ASN.1 DER-encoded PKCS#8 private key to the given path. Read more
Source§fn write_pkcs8_pem_file(
&self,
path: impl AsRef<Path>,
line_ending: LineEnding,
) -> Result<(), Error>
fn write_pkcs8_pem_file( &self, path: impl AsRef<Path>, line_ending: LineEnding, ) -> Result<(), Error>
Write ASN.1 PEM-encoded PKCS#8 private key to the given path. Read more
Source§impl From<&Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey
impl From<&Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey
Source§impl From<&SigningKey> for KeypairBytes
Available on crate feature pkcs8 only.
impl From<&SigningKey> for KeypairBytes
Available on crate feature
pkcs8 only.Source§fn from(signing_key: &SigningKey) -> Self
fn from(signing_key: &SigningKey) -> Self
Converts to this type from the input type.
Source§impl From<Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey
impl From<Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey
Source§impl Generate for SigningKey
impl Generate for SigningKey
Source§fn try_generate_from_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_generate_from_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
Generate random key using the provided
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
Generate random key using the provided
CryptoRng.Source§impl PartialEq for SigningKey
impl PartialEq for SigningKey
Source§impl PrehashSigner<Signature> for SigningKey
impl PrehashSigner<Signature> for SigningKey
Source§impl Signer<Signature> for SigningKey
impl Signer<Signature> for SigningKey
Source§impl TryFrom<&[u8]> for SigningKey
impl TryFrom<&[u8]> for SigningKey
Source§impl TryFrom<&KeypairBytes> for SigningKey
Available on crate feature pkcs8 only.
impl TryFrom<&KeypairBytes> for SigningKey
Available on crate feature
pkcs8 only.Source§impl TryFrom<KeypairBytes> for SigningKey
Available on crate feature pkcs8 only.
impl TryFrom<KeypairBytes> for SigningKey
Available on crate feature
pkcs8 only.Source§impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey
Available on crate feature pkcs8 only.
impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey
Available on crate feature
pkcs8 only.Source§impl Verifier<Signature> for SigningKey
impl Verifier<Signature> for SigningKey
Source§impl Zeroize for SigningKey
impl Zeroize for SigningKey
impl Eq for SigningKey
impl ZeroizeOnDrop for SigningKey
Auto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnsafeUnpin for SigningKey
impl UnwindSafe for SigningKey
Blanket Implementations§
Source§impl<S, T> AsyncSigner<S> for Twhere
T: Signer<S>,
impl<S, T> AsyncSigner<S> for Twhere
T: Signer<S>,
Source§impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
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<T> DecodePrivateKey for Twhere
T: for<'a> TryFrom<PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>, Error = Error>,
impl<T> DecodePrivateKey for Twhere
T: for<'a> TryFrom<PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>, Error = Error>,
Source§fn from_pkcs8_der(bytes: &[u8]) -> Result<T, Error>
fn from_pkcs8_der(bytes: &[u8]) -> Result<T, Error>
Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format). Read more
Source§fn from_pkcs8_pem(s: &str) -> Result<Self, Error>
fn from_pkcs8_pem(s: &str) -> Result<Self, Error>
Deserialize PKCS#8-encoded private key from PEM. Read more