pub struct EdDsaPublicKey { /* private fields */ }Expand description
Public key for the Edwards-curve signature layer.
Implementations§
Source§impl EdDsaPublicKey
impl EdDsaPublicKey
Sourcepub fn curve(&self) -> &TwistedEdwardsCurve
pub fn curve(&self) -> &TwistedEdwardsCurve
Return the curve parameters.
Sourcepub fn public_point(&self) -> &EdwardsPoint
pub fn public_point(&self) -> &EdwardsPoint
Return the public point A = d·G.
Sourcepub fn to_wire_bytes(&self) -> Vec<u8> ⓘ
pub fn to_wire_bytes(&self) -> Vec<u8> ⓘ
Encode just the public point using the curve’s compressed Edwards form.
Sourcepub fn from_wire_bytes(curve: TwistedEdwardsCurve, bytes: &[u8]) -> Option<Self>
pub fn from_wire_bytes(curve: TwistedEdwardsCurve, bytes: &[u8]) -> Option<Self>
Rebuild a public key from a compressed Edwards point plus explicit curve parameters.
Sourcepub fn verify_message<H: Digest>(
&self,
message: &[u8],
signature: &EdDsaSignature,
) -> bool
pub fn verify_message<H: Digest>( &self, message: &[u8], signature: &EdDsaSignature, ) -> bool
Verify a signature over a raw message byte string.
Sourcepub fn verify_message_bytes<H: Digest>(
&self,
message: &[u8],
signature: &[u8],
) -> bool
pub fn verify_message_bytes<H: Digest>( &self, message: &[u8], signature: &[u8], ) -> bool
Verify a byte-encoded signature produced by EdDsaPrivateKey::sign_message_bytes.
Sourcepub fn to_key_blob(&self) -> Vec<u8> ⓘ
pub fn to_key_blob(&self) -> Vec<u8> ⓘ
Encode the public key in the crate-defined binary format.
Field layout: [p, a, d, n, Gx, Gy, Ax, Ay].
Sourcepub fn from_key_blob(blob: &[u8]) -> Option<Self>
pub fn from_key_blob(blob: &[u8]) -> Option<Self>
Decode a public key from the crate-defined binary format.
pub fn to_pem(&self) -> String
pub fn from_pem(pem: &str) -> Option<Self>
pub fn to_xml(&self) -> String
pub fn from_xml(xml: &str) -> Option<Self>
Trait Implementations§
Source§impl Clone for EdDsaPublicKey
impl Clone for EdDsaPublicKey
Source§fn clone(&self) -> EdDsaPublicKey
fn clone(&self) -> EdDsaPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EdDsaPublicKey
impl Debug for EdDsaPublicKey
Source§impl PartialEq for EdDsaPublicKey
impl PartialEq for EdDsaPublicKey
impl Eq for EdDsaPublicKey
Auto Trait Implementations§
impl Freeze for EdDsaPublicKey
impl RefUnwindSafe for EdDsaPublicKey
impl Send for EdDsaPublicKey
impl Sync for EdDsaPublicKey
impl Unpin for EdDsaPublicKey
impl UnsafeUnpin for EdDsaPublicKey
impl UnwindSafe for EdDsaPublicKey
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