Enum psa_crypto::types::key::Type[][src]

pub enum Type {
Show 14 variants RawData, Hmac, Derive, Aes, Des, Camellia, Arc4, Chacha20, RsaPublicKey, RsaKeyPair, EccKeyPair { curve_family: EccFamily, }, EccPublicKey { curve_family: EccFamily, }, DhKeyPair { group_family: DhFamily, }, DhPublicKey { group_family: DhFamily, },
}
Expand description

Enumeration of key types supported.

Variants

RawData

Not a valid key type for any cryptographic operation but can be used to store arbitrary data in the key store.

Hmac

HMAC key.

Derive

A secret key for derivation.

Aes

Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.

Des

Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).

Camellia

Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.

Arc4

Key for the RC4 stream cipher.

Chacha20

Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.

RsaPublicKey

RSA public key.

RsaKeyPair

RSA key pair: both the private and public key.

EccKeyPair

Fields

curve_family: EccFamily

ECC curve family to use.

Elliptic curve key pair: both the private and public key.

EccPublicKey

Fields

curve_family: EccFamily

ECC curve family to use.

Elliptic curve public key.

DhKeyPair

Fields

group_family: DhFamily

Diffie-Hellman group family to use.

Diffie-Hellman key pair: both the private key and public key.

DhPublicKey

Fields

group_family: DhFamily

Diffie-Hellman group family to use.

Diffie-Hellman public key.

Implementations

Checks if a key type is ECC key pair with any curve family inside.

Checks if a key type is ECC public key with any curve family inside.

Example
use psa_crypto::types::key::{Type, EccFamily};

assert!(Type::EccPublicKey { curve_family: EccFamily::SecpK1}.is_ecc_public_key());

Checks if a key type is RSA public key.

Checks if a key type is DH public key with any group family inside.

Checks if a key type is DH key pair with any group family inside.

Checks if a key type is an asymmetric public key type.

If key is public or key pair, returns the corresponding public key type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.