Struct aws_nitro_enclaves_cose::crypto::Openssl

source ·
pub struct Openssl;
Expand description

Type that implements various cryptographic traits using the OpenSSL library

Trait Implementations§

source§

impl Decryption for Openssl

source§

fn decrypt_aead( algo: EncryptionAlgorithm, key: &[u8], iv: Option<&[u8]>, aad: &[u8], ciphertext: &[u8], tag: &[u8] ) -> Result<Vec<u8>, CoseError>

Like decrypt, but for AEAD ciphers such as AES GCM.

Additional Authenticated Data can be provided in the aad field, and the authentication tag should be provided in the tag field.

source§

impl Encryption for Openssl

source§

fn encrypt_aead( algo: EncryptionAlgorithm, key: &[u8], iv: Option<&[u8]>, aad: &[u8], data: &[u8], tag: &mut [u8] ) -> Result<Vec<u8>, CoseError>

Like encrypt, but for AEAD ciphers such as AES GCM.

Additional Authenticated Data can be provided in the aad field, and the authentication tag will be copied into the tag field.

The size of the tag buffer indicates the required size of the tag. While some ciphers support a range of tag sizes, it is recommended to pick the maximum size. For AES GCM, this is 16 bytes, for example.

source§

impl Entropy for Openssl

source§

fn rand_bytes(buff: &mut [u8]) -> Result<(), CoseError>

Fill the provided buff with cryptographic random values.
source§

impl Hash for Openssl

source§

fn hash(digest: MessageDigest, data: &[u8]) -> Result<Vec<u8>, CoseError>

Computes the hash of the data with provided hash function

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.