Struct optee_utee::crypto_op::OperationInfo

source ·
pub struct OperationInfo { /* private fields */ }
Expand description

Represent the information about a crypto information.

Implementations§

source§

impl OperationInfo

source

pub fn from_raw(raw: TEE_OperationInfo) -> Self

Return the OperationInfo struct based on the raw struct TEE_OperationInfo.

The raw structure contains following fields:

  1. algorithm: One of the algorithm of AlgorithmId.
  2. mode: One of the mode of OperationMode.
  3. maxKeySize: The maximum key sizes of different algorithms as defined in TransientObjectType.
  4. operationClass: One of the constants from OperationConstant.
  5. keySize: 5.1) For an operation that makes no use of keys, 0. 5.2) For an operation that uses a single key, the actual size of this key. 5.3) For an operation that uses multiple keys, 0. (The actual value of keySize can be obtained from OperationInfoMultiple).
  6. requiredKeyUsage: 6.1) For an operation that makes no use of keys, 0. 6.2) For an operation that uses a single key, a bit vector that describes the necessary bits in the object usage for set_key functions to succeed without panicking. 6.3) For an operation that uses multiple keys, 0. (The actual value of requiredKeyUsage can be obtained from OperationInfoMultiple.
  7. digestLength: For a Mac, AE, or Digest, describes the number of bytes in the digest or tag.
  8. handleState: A bit vector describing the current state of the operation. Contains one or more of the HandleFlag.
source

pub fn key_size(&self) -> u32

Return the keySize field of the raw structure TEE_OperationInfo.

source

pub fn max_key_size(&self) -> u32

Return the maxDataSize field of the raw structure TEE_OperationInfo.

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