pub struct AgilePublicKey { /* private fields */ }Expand description
Self-describing, validated crypto-agile public encapsulation key.
Implementations§
Source§impl AgilePublicKey
impl AgilePublicKey
Sourcepub const fn algorithm(&self) -> KemAlgorithm
pub const fn algorithm(&self) -> KemAlgorithm
Returns the KEM algorithm associated with this key.
Sourcepub fn from_raw(
policy: SecurityPolicy,
algorithm: KemAlgorithm,
bytes: &[u8],
) -> Result<Self>
pub fn from_raw( policy: SecurityPolicy, algorithm: KemAlgorithm, bytes: &[u8], ) -> Result<Self>
Imports raw key bytes for an explicit algorithm and enforces policy + spec validation.
Sourcepub fn to_wire_bytes(&self) -> Vec<u8> ⓘ
pub fn to_wire_bytes(&self) -> Vec<u8> ⓘ
Serializes this public key into a self-describing versioned binary format:
QAPK || 0x01 || alg_id(u16 BE) || raw_key_bytes.
Sourcepub fn from_wire_bytes(policy: SecurityPolicy, bytes: &[u8]) -> Result<Self>
pub fn from_wire_bytes(policy: SecurityPolicy, bytes: &[u8]) -> Result<Self>
Deserializes a self-describing public key and enforces policy + spec key checks.
Sourcepub fn encaps(&self, policy: SecurityPolicy) -> Result<(Vec<u8>, SharedSecret)>
pub fn encaps(&self, policy: SecurityPolicy) -> Result<(Vec<u8>, SharedSecret)>
Encapsulates a fresh (kem_ciphertext, shared_secret) using the OS CSPRNG.
Trait Implementations§
Source§impl Clone for AgilePublicKey
impl Clone for AgilePublicKey
Source§impl Debug for AgilePublicKey
impl Debug for AgilePublicKey
impl Eq for AgilePublicKey
Source§impl PartialEq for AgilePublicKey
impl PartialEq for AgilePublicKey
impl StructuralPartialEq for AgilePublicKey
Auto Trait Implementations§
impl Freeze for AgilePublicKey
impl RefUnwindSafe for AgilePublicKey
impl Send for AgilePublicKey
impl Sync for AgilePublicKey
impl Unpin for AgilePublicKey
impl UnsafeUnpin for AgilePublicKey
impl UnwindSafe for AgilePublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more