pub struct PublicKey(/* private fields */);
Expand description
A crypto_box
public key.
This type can be serialized if the serde
feature is enabled.
Implementations§
source§impl PublicKey
impl PublicKey
sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Initialize PublicKey
from a byte array.
sourcepub fn from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
pub fn from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
Initialize PublicKey
from a byte slice.
Returns TryFromSliceError
if the slice length is not exactly equal
to KEY_SIZE
.
Trait Implementations§
source§impl From<MontgomeryPoint> for PublicKey
impl From<MontgomeryPoint> for PublicKey
source§fn from(value: MontgomeryPoint) -> Self
fn from(value: MontgomeryPoint) -> Self
Converts to this type from the input type.
source§impl Ord for PublicKey
impl Ord for PublicKey
source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
source§impl TryFrom<&[u8]> for PublicKey
impl TryFrom<&[u8]> for PublicKey
source§type Error = TryFromSliceError
type Error = TryFromSliceError
The type returned in the event of a conversion error.
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)