Module Psa.Key_type

Key types.

Key types

type t

The type for for psa_key_type.

val none : t

Key categories

val is_unstructured : t -> bool
val is_asymmetric : t -> bool
val is_public_key : t -> bool
val is_key_pair : t -> bool

Symmetric keys

val raw_data : t
val hmac : t
val derive : t
val password : t
val password_hash : t
val pepper : t
val aes : t
val aria : t
val des : t

PSA_KEY_TYPE_DES WARNING Weak and strongly deprecated.

val camellia : t
val sm4 : t
val arc4 : t

PSA_KEY_TYPE_ARC4 WARNING Weak and strongly deprecated.

val chacha20 : t
val xchacha20 : t

RSA keys

val rsa_key_pair : t
val rsa_public_key : t
val is_rsa : t -> bool

Elliptic curve keys

See also Ecc_family.

val ecc_key_pair : Ecc_family.t -> t
val ecc_public_key : Ecc_family.t -> t
val is_ecc : t -> bool
val is_ecc_key_pair : t -> bool
val is_ecc_public_key : t -> bool
val ecc_get_family : t -> Ecc_family.t

Diffie-Hellman keys

See also Dh_family.

val dh_key_pair : Dh_family.t -> t
val dh_public_key : Dh_family.t -> t
val is_dh : t -> bool
val is_dh_key_pair : t -> bool
val is_dh_public_key : t -> bool
val dh_get_family : t -> Dh_family.t

Generic public keys

val key_pair_of_public_key : t -> t
val public_key_of_key_pair : t -> t

Predicates and comparisons

val equal : t -> t -> bool

equal t0 t1 is true iff t0 and t1 are equal.

val compare : t -> t -> int

compare is a total order compatible with equal.

Converting

val to_uint16 : t -> uint16

to_uint16 t is t as an unsigned 16-bit integer.

val of_uint16 : uint16 -> t

of_uint16 i is a key type from i.

Formatting

val pp : Stdlib.Format.formatter -> t -> unit

pp formats key types for inspection.