pub enum StaticPrivateKey {
X25519(StaticSecret),
}Expand description
Static private key.
Variants§
X25519(StaticSecret)
X25519.
Implementations§
Source§impl StaticPrivateKey
impl StaticPrivateKey
Sourcepub fn random(csprng: impl RngCore + CryptoRng) -> Self
pub fn random(csprng: impl RngCore + CryptoRng) -> Self
Create new StaticPrivateKey.
Sourcepub fn public(&self) -> StaticPublicKey
pub fn public(&self) -> StaticPublicKey
Get public key.
Sourcepub fn diffie_hellman<T: AsRef<PublicKey>>(&self, public_key: &T) -> Vec<u8> ⓘ
pub fn diffie_hellman<T: AsRef<PublicKey>>(&self, public_key: &T) -> Vec<u8> ⓘ
Perform Diffie-Hellman and return the shared secret as byte vector.
Sourcepub fn from_bytes(bytes: &[u8]) -> Option<Self>
pub fn from_bytes(bytes: &[u8]) -> Option<Self>
Try to create StaticPublicKey from bytes.
Trait Implementations§
Source§impl AsRef<[u8]> for StaticPrivateKey
impl AsRef<[u8]> for StaticPrivateKey
Source§impl Clone for StaticPrivateKey
impl Clone for StaticPrivateKey
Source§fn clone(&self) -> StaticPrivateKey
fn clone(&self) -> StaticPrivateKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StaticPrivateKey
impl RefUnwindSafe for StaticPrivateKey
impl Send for StaticPrivateKey
impl Sync for StaticPrivateKey
impl Unpin for StaticPrivateKey
impl UnwindSafe for StaticPrivateKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)