pub struct X25519Recipient { /* private fields */ }Expand description
A local X25519 recipient: the materialized static private key
(Zeroizing) plus its key id.
Implementations§
Source§impl X25519Recipient
impl X25519Recipient
Sourcepub const fn new(key_id: KeyId, private: Zeroizing<[u8; 32]>) -> Self
pub const fn new(key_id: KeyId, private: Zeroizing<[u8; 32]>) -> Self
Build a recipient from the 32 private key bytes.
Sourcepub fn from_private_slice(
key_id: KeyId,
bytes: &[u8],
) -> Result<Self, KeyLengthError>
pub fn from_private_slice( key_id: KeyId, bytes: &[u8], ) -> Result<Self, KeyLengthError>
Wrap a raw private key slice, failing closed (never indexing) on a
wrong length. The caller should hand the slice from a Zeroizing
buffer; the copy taken here is itself Zeroizing.
§Errors
KeyLengthError if bytes is not exactly 32 bytes.
Sourcepub fn public(&self) -> X25519RecipientPublic
pub fn public(&self) -> X25519RecipientPublic
The corresponding public half (derived; the private never leaves).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for X25519Recipient
impl RefUnwindSafe for X25519Recipient
impl Send for X25519Recipient
impl Sync for X25519Recipient
impl Unpin for X25519Recipient
impl UnsafeUnpin for X25519Recipient
impl UnwindSafe for X25519Recipient
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