pub struct Signature(/* private fields */);Expand description
ECDSA signature object.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn to_be_bytes(&self) -> Box<[u8]>
pub fn to_be_bytes(&self) -> Box<[u8]>
Returns the signature serialized as concatenated r and s
in big endian order (32+32 bytes).
Sourcepub fn try_from_be_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn try_from_be_bytes(bytes: &[u8]) -> Result<Self, String>
Restores the signature from concatenated r and s
in big endian order (32+32 bytes).
Sourcepub fn to_der_bytes(&self) -> Box<[u8]>
pub fn to_der_bytes(&self) -> Box<[u8]>
Returns the signature serialized in ASN.1 DER format.
Sourcepub fn try_from_der_bytes(bytes: &[u8]) -> Result<Self, String>
pub fn try_from_der_bytes(bytes: &[u8]) -> Result<Self, String>
Restores the signature from a bytestring in ASN.1 DER format.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signature
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Signature
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFromBytes for Signature
Available on crate feature serde only.
impl TryFromBytes for Signature
Available on crate feature
serde only.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
Mutably borrows from an owned value. Read more