#[repr(C)]pub struct Signature { /* private fields */ }
Expand description
Ed25519 signature.
This type represents a container for the byte serialization of an Ed25519 signature, and does not necessarily represent well-formed field or curve elements.
Signature verification libraries are expected to reject invalid field elements at the time a signature is verified.
Implementations§
source§impl Signature
impl Signature
sourcepub fn from_bytes(bytes: &[u8; 64]) -> Signature
pub fn from_bytes(bytes: &[u8; 64]) -> Signature
Parse an Ed25519 signature from a byte slice.
sourcepub fn from_components(R: [u8; 32], s: [u8; 32]) -> Signature
pub fn from_components(R: [u8; 32], s: [u8; 32]) -> Signature
Parse an Ed25519 signature from its R
and s
components.
Trait Implementations§
source§impl<D> DigestSigner<D, Signature> for Context<'_, '_, SigningKey>
impl<D> DigestSigner<D, Signature> for Context<'_, '_, SigningKey>
Equivalent to SigningKey::sign_prehashed
with context
set to Some
containing self.value()
.
§Note
The RFC only permits SHA-512 to be used for prehashing. This function technically works, and is
probably safe to use, with any secure hash function with 512-bit digests, but anything outside
of SHA-512 is NOT specification-compliant. We expose crate::Sha512
for user convenience.
source§fn try_sign_digest(&self, msg_digest: D) -> Result<Signature, SignatureError>
fn try_sign_digest(&self, msg_digest: D) -> Result<Signature, SignatureError>
Digest
, returning a
digital signature on success, or an error if something went wrong.source§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl<D> DigestSigner<D, Signature> for SigningKey
impl<D> DigestSigner<D, Signature> for SigningKey
Equivalent to SigningKey::sign_prehashed
with context
set to None
.
§Note
The RFC only permits SHA-512 to be used for prehashing. This function technically works, and is
probably safe to use, with any secure hash function with 512-bit digests, but anything outside
of SHA-512 is NOT specification-compliant. We expose crate::Sha512
for user convenience.
source§fn try_sign_digest(&self, msg_digest: D) -> Result<Signature, SignatureError>
fn try_sign_digest(&self, msg_digest: D) -> Result<Signature, SignatureError>
Digest
, returning a
digital signature on success, or an error if something went wrong.source§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl<MsgDigest> DigestVerifier<MsgDigest, Signature> for Context<'_, '_, VerifyingKey>
impl<MsgDigest> DigestVerifier<MsgDigest, Signature> for Context<'_, '_, VerifyingKey>
Equivalent to VerifyingKey::verify_prehashed
with context
set to Some
containing self.value()
.
source§fn verify_digest(
&self,
msg_digest: MsgDigest,
signature: &Signature,
) -> Result<(), SignatureError>
fn verify_digest( &self, msg_digest: MsgDigest, signature: &Signature, ) -> Result<(), SignatureError>
Digest
output.source§impl<MsgDigest> DigestVerifier<MsgDigest, Signature> for VerifyingKey
impl<MsgDigest> DigestVerifier<MsgDigest, Signature> for VerifyingKey
Equivalent to VerifyingKey::verify_prehashed
with context
set to None
.
source§fn verify_digest(
&self,
msg_digest: MsgDigest,
signature: &Signature,
) -> Result<(), SignatureError>
fn verify_digest( &self, msg_digest: MsgDigest, signature: &Signature, ) -> Result<(), SignatureError>
Digest
output.source§impl FromStr for Signature
impl FromStr for Signature
Decode a signature from hexadecimal.
Upper and lower case hexadecimal are both accepted, however mixed case is rejected.
source§impl SignatureEncoding for Signature
impl SignatureEncoding for Signature
source§impl Signer<Signature> for SigningKey
impl Signer<Signature> for SigningKey
source§impl Verifier<Signature> for SigningKey
impl Verifier<Signature> for SigningKey
source§impl Verifier<Signature> for VerifyingKey
impl Verifier<Signature> for VerifyingKey
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)