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

Information about a particular mechanism

Implementations§

source§

impl MechanismInfo

source

pub fn min_key_size(&self) -> usize

The minimum size of the key for the mechanism

Conformance: Whether this is measured in bits or in bytes is mechanism-dependent. For some mechanisms, this field may be meaningless and take any value.

source

pub fn max_key_size(&self) -> usize

The maximum size of the key for the mechanism

Conformance: Whether this is measured in bits or in bytes is mechanism-dependent For some mechanisms, this field may be meaningless and take any value.

source

pub fn hardware(&self) -> bool

True if the mechanism is performed by the device; false if the mechanism is performed in software

source

pub fn encrypt(&self) -> bool

True if the mechanism can be used to encrypt data

See Session::encrypt

source

pub fn decrypt(&self) -> bool

True if the mechanism can be used to decrypt encrypted data

See Session::decrypt

source

pub fn digest(&self) -> bool

True if the mechanism can be used to digest a message

source

pub fn sign(&self) -> bool

True if the mechanism can be used to digitally sign data

See Session::sign

source

pub fn sign_recover(&self) -> bool

True if the mechanism can be used to digitally data which can be recovered from the signature

source

pub fn verify(&self) -> bool

True if the mechanism can be used to verify a digital signature

See Session::verify

source

pub fn verify_recover(&self) -> bool

True if the mechanism can be used to verify a digital signature and recover the signed data

source

pub fn generate(&self) -> bool

True if the mechanism can be used to generate a secret key

source

pub fn generate_key_pair(&self) -> bool

True if the mechanism can be used to generate a public/private key pair

See Session::generate_key_pair)

source

pub fn wrap(&self) -> bool

True if the mechanism can be used to wrap (encrypt) a key

source

pub fn unwrap(&self) -> bool

True if the mechanism can be used to unwrap (decrypt) a key

source

pub fn derive(&self) -> bool

True if the mechanism can be used to derive a key from a base key

source

pub fn extension(&self) -> bool

True if there is an extension to the flags; false if no extensions

Conformance: This must be false for PKCS#11 v2.40

source

pub fn ec_f_p(&self) -> bool

True if the mechanism can be used to with elliptic curve domain parameters over Fp

Conformance: At least one of ec_f_p and ec_f_2m must be true

source

pub fn ec_f_2m(&self) -> bool

True if the mechanism can be used with elliptic curve domain parameters over F2m

Conformance: At least one of ec_f_p and ec_f_2m must be true

source

pub fn ec_from_parameters(&self) -> bool

True if the mechanism supports specifying elliptic curve domain parameters explicitly

Conformance: At least one of ec_from_parameters and ec_from_named_curve must be true

source

pub fn ec_from_named_curve(&self) -> bool

True if the mechanism supports specifying elliptic curve domain parameters with a named curve

Conformance: At least one of ec_from_parameters and ec_from_named_curve must be true

source

pub fn ec_uncompressed(&self) -> bool

True if the mechanism can be used with elliptic curve points in uncompressed form

Conformance: At least one of ec_uncompressed and ec_compressed must be true

source

pub fn ec_compressed(&self) -> bool

True if the mechanism can be used with elliptic curve points in compressed form

Conformance: At least one of ec_uncompressed and ec_compressed must be true

Trait Implementations§

source§

impl Clone for MechanismInfo

source§

fn clone(&self) -> MechanismInfo

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 MechanismInfo

source§

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

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

impl Copy for MechanismInfo

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