Ed448SigningKey

Struct Ed448SigningKey 

Source
pub struct Ed448SigningKey { /* private fields */ }
Expand description

Signing key for Ed448

Implementations§

Source§

impl SigningKey

Source

pub fn generate<R>(rng: &mut R) -> SigningKey
where R: CryptoRng + ?Sized,

Generate a cryptographically random SigningKey.

Source

pub fn to_bytes(&self) -> Array<u8, <Ed448 as CurveWithScalar>::ReprSize>

Serialize this SigningKey as bytes.

Source

pub fn as_bytes(&self) -> &Array<u8, <Ed448 as CurveWithScalar>::ReprSize>

Serialize this SigningKey as a byte reference.

Source

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.

Source

pub fn verifying_key(&self) -> VerifyingKey

Get the VerifyingKey for this SigningKey.

Source

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

Source

pub fn sign_raw(&self, message: &[u8]) -> Signature

Sign a message with this SigningKey using the Ed448 algorithm defined in RFC8032 §5.2.

Source

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.

Source

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

Source§

fn clone(&self) -> SigningKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ConstantTimeEq for SigningKey

Source§

fn ct_eq(&self, other: &SigningKey) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl Debug for SigningKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<D> DigestSigner<D, Signature> for SigningKey
where D: Digest + Update,

Source§

fn try_sign_digest<F>(&self, f: F) -> Result<Signature, Error>
where F: Fn(&mut D) -> Result<(), Error>,

Attempt to sign a message by updating the received Digest with it, returning a digital signature on success, or an error if something went wrong. Read more
Source§

fn sign_digest<F>(&self, f: F) -> S
where F: Fn(&mut D),

Sign a message by updating the received Digest with it, returning a signature. Read more
Source§

impl<D> DigestVerifier<D, Signature> for SigningKey
where D: Digest + Update,

Source§

fn verify_digest<F>(&self, f: F, signature: &Signature) -> Result<(), Error>
where F: Fn(&mut D) -> Result<(), Error>,

Verify the signature against the received Digest output, by updating it with the message. Read more
Source§

impl Drop for SigningKey

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl DynSignatureAlgorithmIdentifier for SigningKey

Source§

fn signature_algorithm_identifier( &self, ) -> Result<AlgorithmIdentifier<Any>, Error>

AlgorithmIdentifier for the corresponding signature system.
Source§

impl EncodePrivateKey for SigningKey

Source§

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>

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>

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>

Write ASN.1 PEM-encoded PKCS#8 private key to the given path
Source§

impl From<&Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey

Source§

fn from( secret_scalar: &Array<u8, <Ed448 as CurveWithScalar>::ReprSize>, ) -> SigningKey

Converts to this type from the input type.
Source§

impl From<Array<u8, <Ed448 as CurveWithScalar>::ReprSize>> for SigningKey

Source§

fn from( secret_scalar: Array<u8, <Ed448 as CurveWithScalar>::ReprSize>, ) -> SigningKey

Converts to this type from the input type.
Source§

impl PartialEq for SigningKey

Source§

fn eq(&self, other: &SigningKey) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PrehashSigner<Signature> for SigningKey

Source§

fn sign_prehash(&self, prehash: &[u8]) -> Result<Signature, Error>

Attempt to sign the given message digest, returning a digital signature on success, or an error if something went wrong. Read more
Source§

impl Signer<Signature> for SigningKey

Source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature, 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(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature
Source§

impl SigningKey for Ed448SigningKey

Source§

fn sign(&self, message: &[u8]) -> Vec<u8>

Sign the message using this key.
Source§

fn from_pkcs8_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Create a new key from a PKCS8 DER.
Source§

fn verifying_key(&self) -> Box<dyn VerifyingKey>

Create a verifying key from this key.
Source§

impl TryFrom<&[u8]> for SigningKey

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from( value: &[u8], ) -> Result<SigningKey, <SigningKey as TryFrom<&[u8]>>::Error>

Performs the conversion.
Source§

impl TryFrom<&KeypairBytes> for SigningKey

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( value: &KeypairBytes, ) -> Result<SigningKey, <SigningKey as TryFrom<&KeypairBytes>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Vec<u8>> for SigningKey

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from( value: &Vec<u8>, ) -> Result<SigningKey, <SigningKey as TryFrom<&Vec<u8>>>::Error>

Performs the conversion.
Source§

impl TryFrom<Box<[u8]>> for SigningKey

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from( value: Box<[u8]>, ) -> Result<SigningKey, <SigningKey as TryFrom<Box<[u8]>>>::Error>

Performs the conversion.
Source§

impl TryFrom<KeypairBytes> for SigningKey

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( value: KeypairBytes, ) -> Result<SigningKey, <SigningKey as TryFrom<KeypairBytes>>::Error>

Performs the conversion.
Source§

impl TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>> for SigningKey

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from( value: PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>, ) -> Result<SigningKey, <SigningKey as TryFrom<PrivateKeyInfo<AnyRef<'_>, &OctetStringRef, BitStringRef<'_>>>>::Error>

Performs the conversion.
Source§

impl TryFrom<Vec<u8>> for SigningKey

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_from( value: Vec<u8>, ) -> Result<SigningKey, <SigningKey as TryFrom<Vec<u8>>>::Error>

Performs the conversion.
Source§

impl Verifier<Signature> for SigningKey

Source§

fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), Error>

Use Self to verify that the provided signature for a given message bytestring is authentic. Read more
Source§

impl Zeroize for SigningKey

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl Eq for SigningKey

Source§

impl ZeroizeOnDrop for SigningKey

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<S, T> AsyncSigner<S> for T
where T: Signer<S>,

Source§

async fn sign_async(&self, msg: &[u8]) -> Result<S, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DecodePrivateKey for T
where T: for<'a> TryFrom<PrivateKeyInfo<AnyRef<'a>, &'a OctetStringRef, BitStringRef<'a>>, Error = Error>,

Source§

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>

Deserialize PKCS#8-encoded private key from PEM. Read more
Source§

fn read_pkcs8_der_file(path: impl AsRef<Path>) -> Result<Self, Error>

Load PKCS#8 private key from an ASN.1 DER-encoded file on the local filesystem (binary format).
Source§

fn read_pkcs8_pem_file(path: impl AsRef<Path>) -> Result<Self, Error>

Load PKCS#8 private key from a PEM-encoded file on the local filesystem.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V