Skip to main content

GenericVerifyingKey

Struct GenericVerifyingKey 

Source
pub struct GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,
{ /* private fields */ }
Expand description

Verifying key for checking the validity of RSASSA-PSS signatures as described in RFC8017 § 8.1.

Implementations§

Source§

impl<D, T, M> GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source

pub fn new(key: GenericRsaPublicKey<T, M>) -> Self

Create a new RSASSA-PSS verifying key. Digest output size is used as a salt length.

Source

pub fn new_with_salt_len( key: GenericRsaPublicKey<T, M>, salt_len: usize, ) -> Self

Create a new RSASSA-PSS verifying key.

Source

pub fn new_with_auto_salt_len(key: GenericRsaPublicKey<T, M>) -> Self

Create a new RSASSA-PSS verifying key. Attempts to automatically detect the salt length.

Source

pub fn salt_len(&self) -> Option<usize>

Return specified salt length for this key

Trait Implementations§

Source§

impl<D, T, M> AsRef<GenericRsaPublicKey<T, M>> for GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn as_ref(&self) -> &GenericRsaPublicKey<T, M>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<D, T, M> Clone for GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T> + Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D, T, M> Debug for GenericVerifyingKey<D, T, M>
where D: Digest + Debug, T: UnsignedModularInt + Debug, M: ModulusParams<Modulus = T> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D, T, M> DigestVerifier<D, GenericSignature<T>> for GenericVerifyingKey<D, T, M>
where D: Digest + FixedOutputReset + Update, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn verify_digest<F: Fn(&mut D) -> Result<()>>( &self, f: F, signature: &GenericSignature<T>, ) -> Result<()>

Verify the signature against the received Digest output, by updating it with the message. Read more
Source§

impl<D, T, M> From<GenericRsaPublicKey<T, M>> for GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn from(key: GenericRsaPublicKey<T, M>) -> Self

Converts to this type from the input type.
Source§

impl<D, T, M> From<GenericVerifyingKey<D, T, M>> for GenericRsaPublicKey<T, M>
where D: Digest, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn from(key: GenericVerifyingKey<D, T, M>) -> Self

Converts to this type from the input type.
Source§

impl<D, T, M> PartialEq for GenericVerifyingKey<D, T, M>
where D: Digest, T: UnsignedModularInt + PartialEq, M: ModulusParams<Modulus = T>,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, T, M> PrehashVerifier<GenericSignature<T>> for GenericVerifyingKey<D, T, M>
where D: Digest + FixedOutputReset, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn verify_prehash( &self, prehash: &[u8], signature: &GenericSignature<T>, ) -> Result<()>

Use Self to verify that the provided signature for a given message prehash is authentic. Read more
Source§

impl<D, T, M> Verifier<GenericSignature<T>> for GenericVerifyingKey<D, T, M>
where D: Digest + FixedOutputReset, T: UnsignedModularInt, M: ModulusParams<Modulus = T>,

Source§

fn verify(&self, msg: &[u8], signature: &GenericSignature<T>) -> Result<()>

Use Self (e.g. a verifying key) to verify that the provided signature is authentic for a given message bytestring. Read more

Auto Trait Implementations§

§

impl<D, T, M> Freeze for GenericVerifyingKey<D, T, M>
where T: Freeze, M: Freeze,

§

impl<D, T, M> RefUnwindSafe for GenericVerifyingKey<D, T, M>

§

impl<D, T, M> Send for GenericVerifyingKey<D, T, M>
where T: Send, M: Send, D: Send,

§

impl<D, T, M> Sync for GenericVerifyingKey<D, T, M>
where T: Sync, M: Sync, D: Sync,

§

impl<D, T, M> Unpin for GenericVerifyingKey<D, T, M>
where T: Unpin, M: Unpin, D: Unpin,

§

impl<D, T, M> UnsafeUnpin for GenericVerifyingKey<D, T, M>
where T: UnsafeUnpin, M: UnsafeUnpin,

§

impl<D, T, M> UnwindSafe for GenericVerifyingKey<D, T, M>
where T: UnwindSafe, M: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<S, T> AsyncVerifier<S> for T
where T: Verifier<S>,

Source§

async fn verify_async(&self, msg: &[u8], signature: &S) -> Result<(), Error>

Asynchronously verify that the provided signature for a given message bytestring is authentic. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DecodePublicKey for T
where T: for<'a> TryFrom<SubjectPublicKeyInfo<AnyRef<'a>, BitStringRef<'a>>, Error = Error>,

Source§

fn from_public_key_der(bytes: &[u8]) -> Result<T, Error>

Deserialize object from ASN.1 DER-encoded [SubjectPublicKeyInfo] (binary format). Read more
Source§

fn from_public_key_pem(s: &str) -> Result<Self, Error>

Available on crate feature pem only.
Deserialize PEM-encoded [SubjectPublicKeyInfo]. Read more
Source§

fn read_public_key_der_file(path: impl AsRef<Path>) -> Result<Self, Error>

Available on crate feature std only.
Load public key object from an ASN.1 DER-encoded file on the local filesystem (binary format). Read more
Source§

fn read_public_key_pem_file(path: impl AsRef<Path>) -> Result<Self, Error>

Available on crate features pem and std only.
Load public key object from a PEM-encoded file on the local filesystem. Read more
Source§

impl<T> DynAssociatedAlgorithmIdentifier for T

Source§

fn algorithm_identifier(&self) -> Result<AlgorithmIdentifier<Any>, Error>

AlgorithmIdentifier for this structure. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,