pub struct Operation {
    pub key_name: String,
    pub alg: AsymmetricSignature,
    pub hash: Zeroizing<Vec<u8>>,
    pub signature: Zeroizing<Vec<u8>>,
}
Expand description

Native object for asymmetric verification of signatures.

Fields§

§key_name: String

key_name specifies the key to be used for verification.

§alg: AsymmetricSignature

An asymmetric signature algorithm that separates the hash and sign operations, that is compatible with the type of key.

§hash: Zeroizing<Vec<u8>>

The hash contains a short message or hash value as described for the asymmetric signing operation.

§signature: Zeroizing<Vec<u8>>

Buffer containing the signature to verify.

Implementations§

source§

impl Operation

source

pub fn validate(&self, key_attributes: Attributes) -> Result<()>

Validate the contents of the operation against the attributes of the key it targets

This method checks that:

  • the key policy allows verifying signatures on hashes
  • the key policy allows the verification algorithm requested in the operation
  • the key type is compatible with the requested algorithm
  • the length of the given digest is consistent with the specified verification algorithm

Trait Implementations§

source§

impl Debug for Operation

source§

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

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

impl From<Operation> for NativeOperation

source§

fn from(op: Operation) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.