pub struct EcdsaSig(_);
Expand description
A low level interface to ECDSA
OpenSSL documentation at ECDSA_sign
Implementations
sourceimpl EcdsaSig
impl EcdsaSig
sourcepub fn sign<T>(data: &[u8], eckey: &EcKeyRef<T>) -> Result<EcdsaSig, ErrorStack> where
T: HasPrivate,
pub fn sign<T>(data: &[u8], eckey: &EcKeyRef<T>) -> Result<EcdsaSig, ErrorStack> where
T: HasPrivate,
Computes a digital signature of the hash value data
using the private EC key eckey.
OpenSSL documentation at ECDSA_do_sign
sourcepub fn from_private_components(
r: BigNum,
s: BigNum
) -> Result<EcdsaSig, ErrorStack>
pub fn from_private_components(
r: BigNum,
s: BigNum
) -> Result<EcdsaSig, ErrorStack>
Returns a new EcdsaSig
by setting the r
and s
values associated with a
ECDSA signature.
OpenSSL documentation at ECDSA_SIG_set0
sourcepub fn from_der(der: &[u8]) -> Result<EcdsaSig, ErrorStack>
pub fn from_der(der: &[u8]) -> Result<EcdsaSig, ErrorStack>
Decodes a DER-encoded ECDSA signature.
This corresponds to d2i_ECDSA_SIG
.
Methods from Deref<Target = EcdsaSigRef>
sourcepub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the ECDSA signature into a DER-encoded ECDSASignature structure.
This corresponds to i2d_ECDSA_SIG
.
sourcepub fn verify<T>(
&self,
data: &[u8],
eckey: &EcKeyRef<T>
) -> Result<bool, ErrorStack> where
T: HasPublic,
pub fn verify<T>(
&self,
data: &[u8],
eckey: &EcKeyRef<T>
) -> Result<bool, ErrorStack> where
T: HasPublic,
Verifies if the signature is a valid ECDSA signature using the given public key.
OpenSSL documentation at ECDSA_do_verify
sourcepub fn r(&self) -> &BigNumRef
pub fn r(&self) -> &BigNumRef
Returns internal component: r
of an EcdsaSig
. (See X9.62 or FIPS 186-2)
OpenSSL documentation at ECDSA_SIG_get0
sourcepub fn s(&self) -> &BigNumRef
pub fn s(&self) -> &BigNumRef
Returns internal components: s
of an EcdsaSig
. (See X9.62 or FIPS 186-2)
OpenSSL documentation at ECDSA_SIG_get0
Trait Implementations
sourceimpl AsRef<EcdsaSigRef> for EcdsaSig
impl AsRef<EcdsaSigRef> for EcdsaSig
sourcefn as_ref(&self) -> &EcdsaSigRef
fn as_ref(&self) -> &EcdsaSigRef
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<EcdsaSigRef> for EcdsaSig
impl Borrow<EcdsaSigRef> for EcdsaSig
sourcefn borrow(&self) -> &EcdsaSigRef
fn borrow(&self) -> &EcdsaSigRef
Immutably borrows from an owned value. Read more
sourceimpl Deref for EcdsaSig
impl Deref for EcdsaSig
type Target = EcdsaSigRef
type Target = EcdsaSigRef
The resulting type after dereferencing.
sourcefn deref(&self) -> &EcdsaSigRef
fn deref(&self) -> &EcdsaSigRef
Dereferences the value.
sourceimpl DerefMut for EcdsaSig
impl DerefMut for EcdsaSig
sourcefn deref_mut(&mut self) -> &mut EcdsaSigRef
fn deref_mut(&mut self) -> &mut EcdsaSigRef
Mutably dereferences the value.
sourceimpl ForeignType for EcdsaSig
impl ForeignType for EcdsaSig
impl Send for EcdsaSig
impl Sync for EcdsaSig
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more