[][src]Enum parsec_interface::operations::psa_algorithm::AsymmetricSignature

pub enum AsymmetricSignature {
    RsaPkcs1v15Sign {
        hash_alg: SignHash,
    },
    RsaPkcs1v15SignRaw,
    RsaPss {
        hash_alg: SignHash,
    },
    Ecdsa {
        hash_alg: SignHash,
    },
    EcdsaAny,
    DeterministicEcdsa {
        hash_alg: SignHash,
    },
}

Enumeration of asymmetric signing algorithms supported.

Variants

RsaPkcs1v15Sign

RSA PKCS#1 v1.5 signature with hashing.

Fields of RsaPkcs1v15Sign

hash_alg: SignHash

A hash algorithm to use.

RsaPkcs1v15SignRaw

Raw PKCS#1 v1.5 signature.

RsaPss

RSA PSS signature with hashing.

Fields of RsaPss

hash_alg: SignHash

A hash algorithm to use.

Ecdsa

ECDSA signature with hashing.

Fields of Ecdsa

hash_alg: SignHash

A hash algorithm to use.

EcdsaAny

ECDSA signature without hashing.

DeterministicEcdsa

Deterministic ECDSA signature with hashing.

Fields of DeterministicEcdsa

hash_alg: SignHash

A hash algorithm to use.

Implementations

impl AsymmetricSignature[src]

pub fn is_alg_permitted(self, alg: AsymmetricSignature) -> bool[src]

Check if the alg given for a cryptographic operation is permitted to be used with this algorithm as a policy

Example

use psa_crypto::types::algorithm::{AsymmetricSignature, SignHash, Hash};
assert!(AsymmetricSignature::RsaPkcs1v15Sign { hash_alg: SignHash::Any }
        .is_alg_permitted(AsymmetricSignature::RsaPkcs1v15Sign {
            hash_alg:  SignHash::Specific(Hash::Sha1)
        })
       );
assert!(!AsymmetricSignature::RsaPkcs1v15Sign { hash_alg: SignHash::Specific(Hash::Sha256) }
        .is_alg_permitted(AsymmetricSignature::RsaPkcs1v15Sign {
            hash_alg:  SignHash::Specific(Hash::Sha1)
        })
       );

pub fn is_rsa_alg(self) -> bool[src]

Check if this is a RSA algorithm

pub fn is_ecc_alg(self) -> bool[src]

Check if this is an ECC algorithm

pub fn is_hash_len_permitted(self, hash_len: usize) -> bool[src]

Determines if the given hash length is compatible with the asymmetric signature scheme

Trait Implementations

impl Clone for AsymmetricSignature[src]

impl Copy for AsymmetricSignature[src]

impl Debug for AsymmetricSignature[src]

impl<'de> Deserialize<'de> for AsymmetricSignature[src]

impl From<AsymmetricSignature> for Algorithm[src]

impl PartialEq<AsymmetricSignature> for AsymmetricSignature[src]

impl Serialize for AsymmetricSignature[src]

impl StructuralPartialEq for AsymmetricSignature[src]

impl Zeroize for AsymmetricSignature[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.