pub struct Verifier { /* private fields */ }Expand description
Verifier for verifying signatures for a message using a public key.
This verifier can be configured to allow_malleable mode, which allows
verifying signatures with “high-S” or DER-encoded ones.
By default, this verifier allows only “low-S” signatures.
See also: https://github.com/bluesky-social/atproto/pull/1839
Implementations§
Source§impl Verifier
impl Verifier
Sourcepub fn verify(
&self,
algorithm: Algorithm,
public_key: &[u8],
msg: &[u8],
signature: &[u8],
) -> Result<()>
pub fn verify( &self, algorithm: Algorithm, public_key: &[u8], msg: &[u8], signature: &[u8], ) -> Result<()>
Verify a signature for a message using the given public key.
The algorithm is used to determine the curve for the public key.
Sourcepub fn verify_inner<C>(
&self,
public_key: &[u8],
msg: &[u8],
bytes: &[u8],
) -> Result<()>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
AffinePoint<C>: VerifyPrimitive<C> + FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArrayLength<u8>,
MaxSize<C>: ArrayLength<u8>,
<FieldBytesSize<C> as Add>::Output: Add<MaxOverhead> + ArrayLength<u8>,
pub fn verify_inner<C>(
&self,
public_key: &[u8],
msg: &[u8],
bytes: &[u8],
) -> Result<()>where
C: PrimeCurve + CurveArithmetic + DigestPrimitive,
AffinePoint<C>: VerifyPrimitive<C> + FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArrayLength<u8>,
MaxSize<C>: ArrayLength<u8>,
<FieldBytesSize<C> as Add>::Output: Add<MaxOverhead> + ArrayLength<u8>,
Verify a signature for a message using the given public key.
Any elliptic curve of the generics implementation of ECDSA can be used for parameter C.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Verifier
impl RefUnwindSafe for Verifier
impl Send for Verifier
impl Sync for Verifier
impl Unpin for Verifier
impl UnwindSafe for Verifier
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