Skip to main content

SignatureAlgorithm

Enum SignatureAlgorithm 

Source
#[non_exhaustive]
pub enum SignatureAlgorithm {
Show 37 variants DsaSha1, DsaSha256, HmacSha1, HmacSha224, HmacSha256, HmacSha384, HmacSha512, RsaSha1, RsaSha224, RsaSha256, RsaSha384, RsaSha512, RsaPssSha1, RsaPssSha224, RsaPssSha256, RsaPssSha384, RsaPssSha512, RsaPssSha3_224, RsaPssSha3_256, RsaPssSha3_384, RsaPssSha3_512, RsaPss(RsaPssParameters), EcdsaSha1, EcdsaSha224, EcdsaSha256, EcdsaSha384, EcdsaSha512, EcdsaSha3_224, EcdsaSha3_256, EcdsaSha3_384, EcdsaSha3_512, Ed25519, Ed25519Ctx, Ed25519Ph, Ed448, Ed448Ph, PostQuantum(PqAlgorithm),
}
Expand description

Signature algorithms supported for signing and verification.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

DsaSha1

DSA with SHA-1. Legacy algorithm disabled for signing by default.

§

DsaSha256

DSA with SHA-256 as defined by XMLDSig 1.1.

§

HmacSha1

HMAC with SHA-1. Legacy algorithm disabled for signing by default.

§

HmacSha224

HMAC with SHA-224.

§

HmacSha256

HMAC with SHA-256.

§

HmacSha384

HMAC with SHA-384.

§

HmacSha512

HMAC with SHA-512.

§

RsaSha1

RSA with SHA-1. Legacy algorithm disabled for signing by default.

§

RsaSha224

RSA with SHA-224.

§

RsaSha256

RSA with SHA-256 (most common in SAML).

§

RsaSha384

RSA with SHA-384.

§

RsaSha512

RSA with SHA-512.

§

RsaPssSha1

RSA-PSS with SHA1, matching MGF1 and digest-sized salt.

§

RsaPssSha224

RSA-PSS with SHA224, matching MGF1 and digest-sized salt.

§

RsaPssSha256

RSA-PSS with SHA256, matching MGF1 and digest-sized salt.

§

RsaPssSha384

RSA-PSS with SHA384, matching MGF1 and digest-sized salt.

§

RsaPssSha512

RSA-PSS with SHA512, matching MGF1 and digest-sized salt.

§

RsaPssSha3_224

RSA-PSS with SHA3-224, matching MGF1 and digest-sized salt.

§

RsaPssSha3_256

RSA-PSS with SHA3-256, matching MGF1 and digest-sized salt.

§

RsaPssSha3_384

RSA-PSS with SHA3-384, matching MGF1 and digest-sized salt.

§

RsaPssSha3_512

RSA-PSS with SHA3-512, matching MGF1 and digest-sized salt.

§

RsaPss(RsaPssParameters)

Parameterized RSA-PSS under RFC 9231 section 2.3.9.

§

EcdsaSha1

ECDSA with SHA-1; the key selects the elliptic curve.

§

EcdsaSha224

ECDSA with SHA-224; the key selects the elliptic curve.

§

EcdsaSha256

ECDSA with SHA-256; the key selects the elliptic curve.

§

EcdsaSha384

ECDSA with SHA-384; the key selects the elliptic curve.

§

EcdsaSha512

ECDSA with SHA-512; the key selects the elliptic curve.

§

EcdsaSha3_224

ECDSA with SHA3-224; the key selects the elliptic curve.

§

EcdsaSha3_256

ECDSA with SHA3-256; the key selects the elliptic curve.

§

EcdsaSha3_384

ECDSA with SHA3-384; the key selects the elliptic curve.

§

EcdsaSha3_512

ECDSA with SHA3-512; the key selects the elliptic curve.

§

Ed25519

Pure Ed25519 (RFC 8032), without external prehash or context.

§

Ed25519Ctx

Ed25519 with RFC 8032 domain-separation context, without prehash.

§

Ed25519Ph

Ed25519ph with SHA-512 prehash and RFC 8032 domain separation.

§

Ed448

Pure Ed448 (RFC 8032), with an optional domain-separation context.

§

Ed448Ph

Ed448ph with SHAKE256 prehash and RFC 8032 domain separation.

§

PostQuantum(PqAlgorithm)

Experimental post-quantum method; compile capability does not grant permission.

Implementations§

Source§

impl SignatureAlgorithm

Source

pub const ALL: [Self; 45]

Every signature algorithm recognized by this release.

Source

pub fn rsa_pss_parameters(self) -> Option<RsaPssParameters>

Effective PSS parameters for fixed and parameterized method identifiers.

Source

pub fn uses_legacy_pss_hash(self) -> bool

Whether either PSS hash needs explicit historical-algorithm permission.

Source

pub const fn ecdsa_digest(self) -> Option<DigestAlgorithm>

Digest selected by an ECDSA method, independently of its key’s curve.

Source

pub const fn hmac_output_bits(self) -> Option<usize>

Return the full HMAC output width for HMAC algorithms.

Source

pub fn from_uri(uri: &str) -> Option<Self>

Parse from an XML algorithm URI.

Source

pub fn uri(self) -> &'static str

Return the XML namespace URI.

Source

pub fn signing_allowed(self) -> bool

Whether this algorithm is allowed for signing (not just verification).

Source

pub const fn requires_explicit_permission(self) -> bool

Whether this optional historical method requires explicit policy permission.

Source

pub const fn is_rsa(self) -> bool

Whether this method uses an RSA key and PKCS#1 signature encoding.

Trait Implementations§

Source§

impl Clone for SignatureAlgorithm

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 Copy for SignatureAlgorithm

Source§

impl Debug for SignatureAlgorithm

Source§

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

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

impl Eq for SignatureAlgorithm

Source§

impl Hash for SignatureAlgorithm

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SignatureAlgorithm

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SignatureAlgorithm

Auto Trait Implementations§

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.