Skip to main content

Pss

Struct Pss 

Source
pub struct Pss<D> {
    pub blinded: bool,
    pub digest: D,
    pub salt_len: Option<usize>,
}
Expand description

Digital signatures using PSS padding.

Fields§

§blinded: bool

Create blinded signatures.

§digest: D

Digest type to use.

§salt_len: Option<usize>

Salt length. Required for signing, optional for verifying.

Implementations§

Source§

impl<D> Pss<D>
where D: Digest,

Source

pub fn new() -> Self

New PSS padding for the given digest. Digest output size is used as a salt length.

Source

pub fn new_with_salt(len: usize) -> Self

New PSS padding for the given digest with a salt value of the given length.

Source

pub fn new_blinded() -> Self

New PSS padding for blinded signatures (RSA-BSSA) for the given digest. Digest output size is used as a salt length.

Source

pub fn new_blinded_with_salt(len: usize) -> Self

New PSS padding for blinded signatures (RSA-BSSA) for the given digest with a salt value of the given length.

Trait Implementations§

Source§

impl<D> Debug for Pss<D>

Source§

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

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

impl<D> Default for Pss<D>
where D: Digest,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<D> SignatureScheme for Pss<D>

Available on crate feature alloc only.
Source§

fn sign<Rng: TryCryptoRng + ?Sized>( self, rng: Option<&mut Rng>, priv_key: &RsaPrivateKey, hashed: &[u8], ) -> Result<Vec<u8>>

Available on crate feature private-key only.
Sign the given digest.
Source§

fn verify<K, T>(self, pub_key: &K, hashed: &[u8], sig: &[u8]) -> Result<()>

Verify a signed message. Read more

Auto Trait Implementations§

§

impl<D> Freeze for Pss<D>
where D: Freeze,

§

impl<D> RefUnwindSafe for Pss<D>
where D: RefUnwindSafe,

§

impl<D> Send for Pss<D>
where D: Send,

§

impl<D> Sync for Pss<D>
where D: Sync,

§

impl<D> Unpin for Pss<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for Pss<D>
where D: UnsafeUnpin,

§

impl<D> UnwindSafe for Pss<D>
where 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<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> 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, 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.