pub struct X25519PublicKey(/* private fields */);Expand description
A Curve25519 public key used for X25519 key agreement.
Implementations§
Source§impl X25519PublicKey
impl X25519PublicKey
pub const KEY_SIZE: usize = 32usize
Sourcepub const fn from_data(data: [u8; 32]) -> Self
pub const fn from_data(data: [u8; 32]) -> Self
Restore an X25519PublicKey from a fixed-size array of bytes.
Sourcepub fn from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
pub fn from_data_ref(data: impl AsRef<[u8]>) -> Result<Self>
Restore an X25519PublicKey from a reference to an array of bytes.
Trait Implementations§
Source§impl AsRef<X25519PublicKey> for X25519PublicKey
impl AsRef<X25519PublicKey> for X25519PublicKey
Source§fn as_ref(&self) -> &X25519PublicKey
fn as_ref(&self) -> &X25519PublicKey
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl CBORTagged for X25519PublicKey
impl CBORTagged for X25519PublicKey
The CBOR tags assocated with this type. If more than one tag is present,
they are considered equivalent for reading, but only the first one is
used for writing.
Source§impl CBORTaggedDecodable for X25519PublicKey
impl CBORTaggedDecodable for X25519PublicKey
Source§fn from_untagged_cbor(untagged_cbor: CBOR) -> Result<Self>
fn from_untagged_cbor(untagged_cbor: CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
Source§fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
Source§impl CBORTaggedEncodable for X25519PublicKey
impl CBORTaggedEncodable for X25519PublicKey
Source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
Source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
Source§impl Clone for X25519PublicKey
impl Clone for X25519PublicKey
Source§fn clone(&self) -> X25519PublicKey
fn clone(&self) -> X25519PublicKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for X25519PublicKey
impl Debug for X25519PublicKey
Source§impl Encrypter for X25519PublicKey
impl Encrypter for X25519PublicKey
fn encapsulation_public_key(&self) -> EncapsulationPublicKey
Source§impl<'a> From<&'a X25519PublicKey> for &'a [u8; 32]
impl<'a> From<&'a X25519PublicKey> for &'a [u8; 32]
Source§fn from(value: &'a X25519PublicKey) -> Self
fn from(value: &'a X25519PublicKey) -> Self
Converts to this type from the input type.
Source§impl From<&X25519PublicKey> for Vec<u8>
impl From<&X25519PublicKey> for Vec<u8>
Source§fn from(key: &X25519PublicKey) -> Self
fn from(key: &X25519PublicKey) -> Self
Converts to this type from the input type.
Source§impl From<&X25519PublicKey> for X25519PublicKey
impl From<&X25519PublicKey> for X25519PublicKey
Source§fn from(key: &X25519PublicKey) -> Self
fn from(key: &X25519PublicKey) -> Self
Converts to this type from the input type.
Source§impl From<Rc<X25519PublicKey>> for X25519PublicKey
impl From<Rc<X25519PublicKey>> for X25519PublicKey
Source§fn from(value: Rc<X25519PublicKey>) -> Self
fn from(value: Rc<X25519PublicKey>) -> Self
Converts to this type from the input type.
Source§impl From<X25519PublicKey> for CBOR
impl From<X25519PublicKey> for CBOR
Source§fn from(value: X25519PublicKey) -> Self
fn from(value: X25519PublicKey) -> Self
Converts to this type from the input type.
Source§impl From<X25519PublicKey> for Vec<u8>
impl From<X25519PublicKey> for Vec<u8>
Source§fn from(key: X25519PublicKey) -> Self
fn from(key: X25519PublicKey) -> Self
Converts to this type from the input type.
Source§impl Hash for X25519PublicKey
impl Hash for X25519PublicKey
Source§impl PartialEq for X25519PublicKey
impl PartialEq for X25519PublicKey
Source§impl TryFrom<CBOR> for X25519PublicKey
impl TryFrom<CBOR> for X25519PublicKey
impl Eq for X25519PublicKey
impl StructuralPartialEq for X25519PublicKey
Auto Trait Implementations§
impl Freeze for X25519PublicKey
impl RefUnwindSafe for X25519PublicKey
impl Send for X25519PublicKey
impl Sync for X25519PublicKey
impl Unpin for X25519PublicKey
impl UnwindSafe for X25519PublicKey
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