pub struct MechanismType { /* private fields */ }
Expand description

Type of a mechanism

Implementations§

source§

impl MechanismType

source

pub const AES_KEY_GEN: MechanismType = _

AES key generation mechanism

source

pub const AES_CBC: MechanismType = _

AES-CBC mechanism

For encryption, the message length must be a multiple of the block size. For wrapping, the mechanism encrypts the value of the key, padded on the trailing end with up to block size minus one null bytes. For unwrapping, the result is truncated according to the key type and the length provided by the template.

source

pub const AES_CBC_PAD: MechanismType = _

AES-CBC with PKCS#7 padding mechanism

The plaintext may be any size. The PKCS#7 padding allows the length of the plaintext to be recovered from the ciphertext. Therefore no length should be provided when unwrapping keys with this mechanism.

source

pub const AES_ECB: MechanismType = _

AES-ECB mechanism

source

pub const AES_KEY_WRAP: MechanismType = _

AES key wrap mechanism. This mechanism can only wrap a key or encrypt a block of data whose length is a multiple of the AES Key Wrap algorithm block size.

source

pub const AES_KEY_WRAP_PAD: MechanismType = _

AES key wrap mechanism. This mechanism can wrap a key or encrypt a block of data of any length. It does the padding detailed in PKCS#7 of inputs.

source

pub const AES_GCM: MechanismType = _

AES-GCM mechanism

source

pub const RSA_PKCS_KEY_PAIR_GEN: MechanismType = _

PKCS #1 RSA key pair generation mechanism

source

pub const RSA_PKCS: MechanismType = _

Multi-purpose mechanism based on the RSA public-key cryptosystem and the block formats initially defined in PKCS #1 v1.5

source

pub const RSA_PKCS_PSS: MechanismType = _

Mechanism based on the RSA public-key cryptosystem and the PSS block format defined in PKCS #1

source

pub const RSA_PKCS_OAEP: MechanismType = _

Multi-purpose mechanism based on the RSA public-key cryptosystem and the OAEP block format defined in PKCS #1

source

pub const RSA_X_509: MechanismType = _

Multi-purpose mechanism based on the RSA public-key cryptosystem. This is so-called “raw” RSA, as assumed in X.509.

source

pub const DES_KEY_GEN: MechanismType = _

DES Note that DES is deprecated. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf section 2, p. 6.

source

pub const DES2_KEY_GEN: MechanismType = _

DES2 Note that DES2 is deprecated. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf section 2, p. 6.

source

pub const DES3_KEY_GEN: MechanismType = _

DES3 Note that DES3 is deprecated. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf section 2, p. 6.

source

pub const DES_CBC: MechanismType = _

DES-CBC mechanism.

For encryption, the message length must be a multiple of the block size. For wrapping, the mechanism encrypts the value of the key, padded on the trailing end with up to block size minus one null bytes. For unwrapping, the result is truncated according to the key type and the length provided by the template.

source

pub const DES3_CBC: MechanismType = _

DES3-CBC mechanism.

For encryption, the message length must be a multiple of the block size. For wrapping, the mechanism encrypts the value of the key, padded on the trailing end with up to block size minus one null bytes. For unwrapping, the result is truncated according to the key type and the length provided by the template.

source

pub const DES_CBC_PAD: MechanismType = _

DES-CBC with PKCS#7 padding mechanism

The plaintext may be any size. The PKCS#7 padding allows the length of the plaintext to be recovered from the ciphertext. Therefore no length should be provided when unwrapping keys with this mechanism.

source

pub const DES3_CBC_PAD: MechanismType = _

DES3-CBC with PKCS#7 padding mechanism

The plaintext may be any size. The PKCS#7 padding allows the length of the plaintext to be recovered from the ciphertext. Therefore no length should be provided when unwrapping keys with this mechanism.

source

pub const DES_ECB: MechanismType = _

DES ECB Note that DES is deprecated. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf section 2, p. 6.

source

pub const DES3_ECB: MechanismType = _

DES3 ECB Note that DES3 is deprecated. See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf section 2, p. 6.

source

pub const ECC_KEY_PAIR_GEN: MechanismType = _

EC key pair generation mechanism

source

pub const ECC_EDWARDS_KEY_PAIR_GEN: MechanismType = _

EC edwards key pair generation mechanism

source

pub const ECC_MONTGOMERY_KEY_PAIR_GEN: MechanismType = _

EC montgomery key pair generation mechanism

source

pub const EDDSA: MechanismType = _

EDDSA mechanism

Note: EdDSA is not part of the PKCS#11 v2.40 standard and as such may not be understood by the backend. It is included here because some vendor implementations support it through the v2.40 interface.

source

pub const ECDH1_DERIVE: MechanismType = _

ECDH key derivation mechanism

source

pub const ECDSA: MechanismType = _

ECDSA mechanism

source

pub const ECDSA_SHA1: MechanismType = _

ECDSA with SHA-1 mechanism

source

pub const ECDSA_SHA224: MechanismType = _

ECDSA with SHA-224 mechanism

source

pub const ECDSA_SHA256: MechanismType = _

ECDSA with SHA-256 mechanism

source

pub const ECDSA_SHA384: MechanismType = _

ECDSA with SHA-384 mechanism

source

pub const ECDSA_SHA512: MechanismType = _

ECDSA with SHA-512 mechanism

source

pub const SHA1: MechanismType = _

SHA-1 mechanism

source

pub const SHA224: MechanismType = _

SHA-224 mechanism

source

pub const SHA256: MechanismType = _

SHA-256 mechanism

source

pub const SHA384: MechanismType = _

SHA-384 mechanism

source

pub const SHA512: MechanismType = _

SHA-512 mechanism

source

pub const SHA1_RSA_PKCS: MechanismType = _

SHA1-RSA-PKCS mechanism

source

pub const SHA224_RSA_PKCS: MechanismType = _

SHA224-RSA-PKCS mechanism

source

pub const SHA256_RSA_PKCS: MechanismType = _

SHA256-RSA-PKCS mechanism

source

pub const SHA384_RSA_PKCS: MechanismType = _

SHA384-RSA-PKCS mechanism

source

pub const SHA512_RSA_PKCS: MechanismType = _

SHA512-RSA-PKCS mechanism

source

pub const SHA1_RSA_PKCS_PSS: MechanismType = _

SHA1-RSA-PKCS-PSS mechanism

source

pub const SHA256_RSA_PKCS_PSS: MechanismType = _

SHA256-RSA-PKCS-PSS mechanism

source

pub const SHA384_RSA_PKCS_PSS: MechanismType = _

SHA384-RSA-PKCS-PSS mechanism

source

pub const SHA512_RSA_PKCS_PSS: MechanismType = _

SHA512-RSA-PKCS-PSS mechanism

Trait Implementations§

source§

impl Clone for MechanismType

source§

fn clone(&self) -> MechanismType

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for MechanismType

source§

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

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

impl Deref for MechanismType

§

type Target = u64

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Display for MechanismType

source§

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

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

impl From<MechanismType> for CK_MECHANISM_TYPE

source§

fn from(mechanism_type: MechanismType) -> Self

Converts to this type from the input type.
source§

impl PartialEq for MechanismType

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u64> for MechanismType

§

type Error = Error

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

fn try_from(mechanism_type: CK_MECHANISM_TYPE) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for MechanismType

source§

impl Eq for MechanismType

source§

impl StructuralPartialEq for MechanismType

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<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> ToOwned for T
where T: Clone,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.