pub struct Ed448SigningKey { /* private fields */ }Expand description
Signing key for Ed448
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn generate<R>(rng: &mut R) -> SigningKey
pub fn generate<R>(rng: &mut R) -> SigningKey
Generate a cryptographically random SigningKey.
Sourcepub fn to_bytes(&self) -> Array<u8, <Ed448 as CurveWithScalar>::ReprSize>
pub fn to_bytes(&self) -> Array<u8, <Ed448 as CurveWithScalar>::ReprSize>
Serialize this SigningKey as bytes.
Sourcepub fn as_bytes(&self) -> &Array<u8, <Ed448 as CurveWithScalar>::ReprSize>
pub fn as_bytes(&self) -> &Array<u8, <Ed448 as CurveWithScalar>::ReprSize>
Serialize this SigningKey as a byte reference.
Sourcepub fn to_scalar(&self) -> Scalar<Ed448>
pub fn to_scalar(&self) -> Scalar<Ed448>
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, SigningKey>
pub fn with_context<'k, 'v>( &'k self, context: &'v [u8], ) -> Context<'k, 'v, SigningKey>
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
impl DynSignatureAlgorithmIdentifier for SigningKey
Source§fn signature_algorithm_identifier(
&self,
) -> Result<AlgorithmIdentifier<Any>, Error>
fn signature_algorithm_identifier( &self, ) -> Result<AlgorithmIdentifier<Any>, Error>
AlgorithmIdentifier for the corresponding signature system.Source§impl EncodePrivateKey for SigningKey
impl EncodePrivateKey for SigningKey
Source§fn to_pkcs8_der(&self) -> Result<SecretDocument, Error>
fn to_pkcs8_der(&self) -> Result<SecretDocument, Error>
Serialize a
SecretDocument containing a PKCS#8-encoded private key.Source§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.Source§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
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
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 SigningKey for Ed448SigningKey
impl SigningKey for Ed448SigningKey
Source§impl TryFrom<&[u8]> for SigningKey
impl TryFrom<&[u8]> for SigningKey
Source§impl TryFrom<&KeypairBytes> for SigningKey
impl TryFrom<&KeypairBytes> for SigningKey
Source§fn try_from(
value: &KeypairBytes,
) -> Result<SigningKey, <SigningKey as TryFrom<&KeypairBytes>>::Error>
fn try_from( value: &KeypairBytes, ) -> Result<SigningKey, <SigningKey as TryFrom<&KeypairBytes>>::Error>
Performs the conversion.
Source§impl TryFrom<KeypairBytes> for SigningKey
impl TryFrom<KeypairBytes> for SigningKey
Source§fn try_from(
value: KeypairBytes,
) -> Result<SigningKey, <SigningKey as TryFrom<KeypairBytes>>::Error>
fn try_from( value: KeypairBytes, ) -> Result<SigningKey, <SigningKey as TryFrom<KeypairBytes>>::Error>
Performs the conversion.
Source§impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey
impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey
Source§fn try_from(
value: PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>,
) -> Result<SigningKey, <SigningKey as TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>>>::Error>
fn try_from( value: PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>, ) -> Result<SigningKey, <SigningKey as TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>>>::Error>
Performs the conversion.
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 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<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).
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