pub struct PrivateKey(/* private fields */);Expand description
Ed25519 の秘密鍵(RFC 8032 のシード)。使い終わるとメモリを0で上書きする。
中身が表示されたり、読むのにかかる時間から漏れたりしないように、
Display は持たず、16進との変換は定数時間で行う。
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
pub fn from_bytes(bytes: &[u8; 32]) -> Self
32バイトのシードから作る。渡した側の配列は呼び出し側で消す。
Sourcepub fn generate_with_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Self
pub fn generate_with_rng<R: CryptoRng + ?Sized>(rng: &mut R) -> Self
渡された暗号用の乱数で作る。
Trait Implementations§
Source§impl Debug for PrivateKey
impl Debug for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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