pub struct PrivateKey(pub [u8; 32]);Expand description
An Ed25519 private key (raw 32-byte seed).
§Zeroize
PrivateKey derives Zeroize and ZeroizeOnDrop: the 32 seed bytes
are overwritten with zeroes when a value is dropped.
from_string and from_slice
zero their intermediate scratch buffers when they return.
Unredacted::write_string is the encoding path that wraps its scratch
buffers in Zeroizing and writes directly into a caller-provided
buffer, avoiding any return-value move.
Debug emits PrivateKey([REDACTED]). To render the encoded strkey
form, serialize via serde, or emit the raw seed bytes in any form,
wrap the value in Unredacted — see Unredacted’s doc for the full
list of paths that opt-in unlocks.
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl PrivateKey
impl PrivateKey
pub const ENCODED_LEN: usize
Source§impl PrivateKey
impl PrivateKey
pub fn from_payload(payload: &[u8]) -> Result<Self, DecodeError>
pub fn from_string(s: &str) -> Result<Self, DecodeError>
pub fn from_slice(s: &[u8]) -> Result<Self, DecodeError>
Sourcepub fn as_unredacted(&self) -> Unredacted<&Self>
pub fn as_unredacted(&self) -> Unredacted<&Self>
Borrows this private key as an Unredacted wrapper so it can be
rendered via Display or to_string, or
serialized in its strkey string form.