Module Hpke.Private_keySource

Sourcetype t

A validated private key tagged with its KEM. Values are abstract but cannot be reliably zeroized by the OCaml garbage collector.

Sourceval of_bytes : kem:Kem.id -> string -> (t, Error.t) result

Parse and validate an exact-length key. X25519 input is clamped.

Sourceval to_bytes : t -> string

Serialize the key. X25519 output is clamped as required by RFC 9180.

Sourceval kem : t -> Kem.id
Sourceval public_key : t -> Public_key.t