Struct nisty::PublicKey [−][src]
Public part of a keypair, a point on the curve. Verifies signatures.
Implementations
impl PublicKey
[src]
pub fn verify(
&self,
message: &[u8],
signature: impl AsArrayRef<[u8; 64]>
) -> bool
[src]
&self,
message: &[u8],
signature: impl AsArrayRef<[u8; 64]>
) -> bool
Verify that a claimed signature for a message is valid.
pub fn verify_prehashed(
&self,
prehashed_message: &[u8; 32],
signature: impl AsArrayRef<[u8; 64]>
) -> bool
[src]
&self,
prehashed_message: &[u8; 32],
signature: impl AsArrayRef<[u8; 64]>
) -> bool
Verify that a claimed signature for a prehashed message is valid.
pub fn compress(&self) -> [u8; 33]
[src]
This is the “SEC1” representation of a point on an elliptic curve, which is often used in IETF protocols.
Reference: https://tools.ietf.org/html/rfc5480#section-2.2
The first byte contains 2 + the “sign” of the y-coordinate (least significant byte). The following 32 bytes are the x-coordinate in big-endian representation.
Note: The “uncompressed” SEC1 format would prepend byte 0x4, it seems in this case at least everyone uses “raw” encoding: x || y
impl PublicKey
[src]
pub fn x_coordinate(&self) -> [u8; 32]
[src]
pub fn y_coordinate(&self) -> [u8; 32]
[src]
impl PublicKey
[src]
pub fn try_from_bytes(public_key_bytes: &[u8; 64]) -> Result<Self>
[src]
pub fn to_bytes(self) -> [u8; 64]
[src]
pub fn as_bytes(&self) -> &[u8; 64]
[src]
Trait Implementations
impl AsArrayRef<[u8; 64]> for PublicKey
[src]
Serialization of public keys as byte array references.
fn as_array_ref(&self) -> &[u8; 64]
[src]
impl AsArrayRef<[u8; 64]> for &PublicKey
[src]
Serialization of public key references as byte array references.
fn as_array_ref(&self) -> &[u8; 64]
[src]
impl Clone for PublicKey
[src]
fn clone(&self) -> PublicKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PublicKey
[src]
impl Debug for PublicKey
[src]
impl From<&'_ SecretKey> for PublicKey
[src]
impl Into<[u8; 64]> for PublicKey
[src]
Serialization of public keys into byte arrays.
impl PartialEq<PublicKey> for PublicKey
[src]
fn eq(&self, other: &PublicKey) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl TryFrom<&'_ [u8; 64]> for PublicKey
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,