Struct ed25519_dalek::PublicKey
[−]
[src]
#[repr(C)]pub struct PublicKey(pub CompressedEdwardsY);
An ed25519 public key.
Methods
impl PublicKey
[src]
fn to_bytes(&self) -> [u8; 32]
[src]
Convert this public key to a byte array.
fn as_bytes<'a>(&'a self) -> &'a [u8; 32]
[src]
View this public key as a byte array.
fn from_bytes(bytes: &[u8]) -> PublicKey
[src]
Construct a PublicKey
from a slice of bytes.
Warning
The caller is responsible for ensuring that the bytes passed into this
method actually represent a curve25519_dalek::curve::CompressedEdwardsY
and that said compressed point is actually a point on the curve.
Example
use ed25519_dalek::PublicKey; use ed25519_dalek::PUBLIC_KEY_LENGTH; let public_key_bytes: [u8; PUBLIC_KEY_LENGTH] = [ 215, 90, 152, 1, 130, 177, 10, 183, 213, 75, 254, 211, 201, 100, 7, 58, 14, 225, 114, 243, 218, 166, 35, 37, 175, 2, 26, 104, 247, 7, 81, 26]; let public_key: PublicKey = PublicKey::from_bytes(&public_key_bytes);
Returns
A PublicKey
.
fn from_secret<D>(secret_key: &SecretKey) -> PublicKey where
D: Digest<OutputSize = U64> + Default,
[src]
D: Digest<OutputSize = U64> + Default,
Derive this public key from its corresponding SecretKey
.
fn verify<D>(&self, message: &[u8], signature: &Signature) -> bool where
D: Digest<OutputSize = U64> + Default,
[src]
D: Digest<OutputSize = U64> + Default,
Verify a signature on a message with this keypair's public key.
Return
Returns true if the signature was successfully verified, and false otherwise.
Trait Implementations
impl Copy for PublicKey
[src]
impl Clone for PublicKey
[src]
fn clone(&self) -> PublicKey
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more