Struct identity_iota::iota::block::signature::Ed25519Signature
source · pub struct Ed25519Signature { /* private fields */ }
Expand description
An Ed25519 signature.
Implementations§
source§impl Ed25519Signature
impl Ed25519Signature
sourcepub const KIND: u8 = 0u8
pub const KIND: u8 = 0u8
The signature kind of an Ed25519Signature
.
sourcepub const PUBLIC_KEY_LENGTH: usize = 32usize
pub const PUBLIC_KEY_LENGTH: usize = 32usize
Length of an ED25519 public key.
sourcepub const SIGNATURE_LENGTH: usize = 64usize
pub const SIGNATURE_LENGTH: usize = 64usize
Length of an ED25519 signature.
sourcepub fn new(public_key: PublicKey, signature: Signature) -> Ed25519Signature
pub fn new(public_key: PublicKey, signature: Signature) -> Ed25519Signature
Creates a new Ed25519Signature
from a validated public key and signature.
sourcepub fn new_from_bytes(
public_key: PublicKeyBytes,
signature: Signature
) -> Ed25519Signature
pub fn new_from_bytes( public_key: PublicKeyBytes, signature: Signature ) -> Ed25519Signature
Creates a new Ed25519Signature
from public key bytes and signature.
sourcepub fn try_from_bytes(
public_key: [u8; 32],
signature: [u8; 64]
) -> Result<Ed25519Signature, Error>
👎Deprecated since 1.1.4: use Ed25519Signature::from_bytes instead
pub fn try_from_bytes( public_key: [u8; 32], signature: [u8; 64] ) -> Result<Ed25519Signature, Error>
Creates a new Ed25519Signature
from bytes.
sourcepub fn from_bytes(public_key: [u8; 32], signature: [u8; 64]) -> Ed25519Signature
pub fn from_bytes(public_key: [u8; 32], signature: [u8; 64]) -> Ed25519Signature
Creates a new Ed25519Signature
from bytes.
sourcepub fn public_key(&self) -> &PublicKey
👎Deprecated since 1.1.4: use Ed25519Signature::public_key_bytes instead
pub fn public_key(&self) -> &PublicKey
Returns the public key of an Ed25519Signature
.
sourcepub fn public_key_bytes(&self) -> &PublicKeyBytes
pub fn public_key_bytes(&self) -> &PublicKeyBytes
Returns the unvalidated public key bytes of an Ed25519Signature
.
sourcepub fn signature(&self) -> &Signature
pub fn signature(&self) -> &Signature
Return the actual signature of an Ed25519Signature
.
sourcepub fn verify(&self, message: &[u8]) -> bool
👎Deprecated since 1.1.4: use Ed25519Signature::try_verify instead
pub fn verify(&self, message: &[u8]) -> bool
Verify a message using the signature.
sourcepub fn try_verify(&self, message: &[u8]) -> Result<bool, Error>
pub fn try_verify(&self, message: &[u8]) -> Result<bool, Error>
Verify a message using the signature.
sourcepub fn is_valid(
&self,
message: &[u8],
address: &Ed25519Address
) -> Result<(), Error>
pub fn is_valid( &self, message: &[u8], address: &Ed25519Address ) -> Result<(), Error>
Verifies the Ed25519Signature
for a message against an Ed25519Address
.
Trait Implementations§
source§impl Clone for Ed25519Signature
impl Clone for Ed25519Signature
source§fn clone(&self) -> Ed25519Signature
fn clone(&self) -> Ed25519Signature
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Ed25519Signature
impl Debug for Ed25519Signature
source§impl From<&Ed25519Signature> for Ed25519SignatureDto
impl From<&Ed25519Signature> for Ed25519SignatureDto
source§fn from(value: &Ed25519Signature) -> Ed25519SignatureDto
fn from(value: &Ed25519Signature) -> Ed25519SignatureDto
source§impl From<Ed25519Signature> for Signature
impl From<Ed25519Signature> for Signature
source§fn from(value: Ed25519Signature) -> Signature
fn from(value: Ed25519Signature) -> Signature
source§impl Hash for Ed25519Signature
impl Hash for Ed25519Signature
source§impl Ord for Ed25519Signature
impl Ord for Ed25519Signature
source§fn cmp(&self, other: &Ed25519Signature) -> Ordering
fn cmp(&self, other: &Ed25519Signature) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl Packable for Ed25519Signature
impl Packable for Ed25519Signature
§type UnpackError = Error
type UnpackError = Error
§type UnpackVisitor = ()
type UnpackVisitor = ()
source§fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
fn pack<P>(&self, packer: &mut P) -> Result<(), <P as Packer>::Error>where
P: Packer,
Packer
.source§fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<Ed25519Signature as Packable>::UnpackVisitor
) -> Result<Ed25519Signature, UnpackError<<Ed25519Signature as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
fn unpack<U, const VERIFY: bool>(
unpacker: &mut U,
visitor: &<Ed25519Signature as Packable>::UnpackVisitor
) -> Result<Ed25519Signature, UnpackError<<Ed25519Signature as Packable>::UnpackError, <U as Unpacker>::Error>>where
U: Unpacker,
Unpacker
. The VERIFY
generic parameter can be used to skip additional
syntactic checks.source§impl PartialEq for Ed25519Signature
impl PartialEq for Ed25519Signature
source§fn eq(&self, other: &Ed25519Signature) -> bool
fn eq(&self, other: &Ed25519Signature) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Ed25519Signature
impl PartialOrd for Ed25519Signature
source§fn partial_cmp(&self, other: &Ed25519Signature) -> Option<Ordering>
fn partial_cmp(&self, other: &Ed25519Signature) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<Ed25519SignatureDto> for Ed25519Signature
impl TryFrom<Ed25519SignatureDto> for Ed25519Signature
source§fn try_from(
value: Ed25519SignatureDto
) -> Result<Ed25519Signature, <Ed25519Signature as TryFrom<Ed25519SignatureDto>>::Error>
fn try_from( value: Ed25519SignatureDto ) -> Result<Ed25519Signature, <Ed25519Signature as TryFrom<Ed25519SignatureDto>>::Error>
impl Eq for Ed25519Signature
impl StructuralPartialEq for Ed25519Signature
Auto Trait Implementations§
impl Freeze for Ed25519Signature
impl RefUnwindSafe for Ed25519Signature
impl Send for Ed25519Signature
impl Sync for Ed25519Signature
impl Unpin for Ed25519Signature
impl UnwindSafe for Ed25519Signature
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> PackableExt for Pwhere
P: Packable,
impl<P> PackableExt for Pwhere
P: Packable,
source§fn unpack_verified<T>(
bytes: T,
visitor: &<P as Packable>::UnpackVisitor
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_verified<T>( bytes: T, visitor: &<P as Packable>::UnpackVisitor ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>
].
source§fn unpack_unverified<T>(
bytes: T
) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
fn unpack_unverified<T>( bytes: T ) -> Result<P, UnpackError<<P as Packable>::UnpackError, UnexpectedEOF>>
Unpacks this value from a type that implements [AsRef<[u8]>
] skipping some syntatical checks.
source§fn packed_len(&self) -> usize
fn packed_len(&self) -> usize
pack
.