Struct ed25519_dalek::SecretKey
[−]
[src]
pub struct SecretKey(pub [u8; 64]);
An ed25519 private key.
Methods
impl SecretKey
[src]
fn to_bytes(&self) -> [u8; 64]
View this secret key as an array of 32 bytes.
fn from_bytes(bytes: &[u8]) -> SecretKey
Construct a SecretKey
from a slice of bytes.
Warning
The caller is responsible for ensuring that the bytes represent a masked secret key. If you do not understand what this means, DO NOT USE THIS CONSTRUCTOR.
Example
use ed25519_dalek::SecretKey; let secret_key_bytes: [u8; 64] = [ 157, 97, 177, 157, 239, 253, 90, 96, 186, 132, 74, 244, 146, 236, 44, 196, 68, 73, 197, 105, 123, 50, 105, 25, 112, 59, 172, 3, 28, 174, 127, 96, 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_bytes: [u8; 32] = [ 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 secret_key: SecretKey = SecretKey::from_bytes(&[&secret_key_bytes[..32], &public_key_bytes[..32]].concat()[..]);
Returns
A SecretKey
.
fn sign<D>(&self, message: &[u8]) -> Signature where D: Digest<OutputSize=U64> + Default
Sign a message with this keypair's secret key.