Expand description
Pkey<T> — asymmetric key container and operations.
Phase 5 delivers key loading/serialisation (5.1), keygen (5.2), sign/verify (5.3), derive (5.4), asymmetric encrypt/decrypt (5.5), and KEM encapsulate/decapsulate (5.6).
§Type-state markers
Pkey<Private>, Pkey<Public>, and Pkey<Params> statically prevent
misuse (e.g. signing with a public key). HasPrivate: HasPublic means
every Pkey<Private> can also be used wherever Pkey<Public> is needed.
Structs§
- Derive
Ctx - Asymmetric key-agreement context (
EVP_PKEY_CTXin derive mode). - Keygen
Ctx - Context for generating asymmetric key pairs (
EVP_PKEY_CTXin keygen mode). - Params
- Marker: key holds PKEY parameters only (e.g. EC group with no key).
- Pkey
- An asymmetric key (
EVP_PKEY*) with a compile-time role marker. - Pkey
Decrypt Ctx - RSA asymmetric decryption context.
- Pkey
Encrypt Ctx - RSA asymmetric encryption context.
- Private
- Marker: key holds public + private key material.
- Public
- Marker: key holds public key material only.
- RawSigner
- Raw (no-digest) signing context wrapping
EVP_PKEY_CTXafterEVP_PKEY_sign_init. - RawVerifier
- Raw (no-digest) verification context wrapping
EVP_PKEY_CTXafterEVP_PKEY_verify_init. - Sign
Init - Parameters for creating a
SignerorVerifier. - Signer
- Streaming
DigestSigncontext. - Verifier
- Streaming
DigestVerifycontext.
Traits§
- HasParams
- All key markers satisfy this bound.
- HasPrivate
- Private key material is accessible.
- HasPublic
- Public key material is accessible (both
PublicandPrivatekeys).