Struct oasis_core_runtime::common::crypto::x25519::PrivateKey
source · pub struct PrivateKey(pub StaticSecret);
Expand description
A CBOR serializable Diffie-Hellman X25519 private key.
Tuple Fields§
§0: StaticSecret
Implementations§
source§impl PrivateKey
impl PrivateKey
sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Compute corresponding public key.
sourcepub fn from_test_seed(seed: String) -> Self
pub fn from_test_seed(seed: String) -> Self
Generate a new private key from a test key seed.
Trait Implementations§
source§impl AsRef<[u8]> for PrivateKey
impl AsRef<[u8]> for PrivateKey
source§impl Clone for PrivateKey
impl Clone for PrivateKey
source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a copy 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 moresource§impl Decode for PrivateKey
impl Decode for PrivateKey
source§fn try_default() -> Result<Self, DecodeError>
fn try_default() -> Result<Self, DecodeError>
Try to decode from a missing/null/undefined value.
source§fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<Self, DecodeError>
Try to decode from a given CBOR value.
§fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
fn try_from_cbor_value_default(value: Value) -> Result<Self, DecodeError>where
Self: Sized,
Try to decode from a given CBOR value, calling
try_default
in case the value is null or
undefined.source§impl Default for PrivateKey
impl Default for PrivateKey
source§impl Encode for PrivateKey
impl Encode for PrivateKey
source§impl From<&PrivateKey> for PublicKey
impl From<&PrivateKey> for PublicKey
source§fn from(sk: &PrivateKey) -> PublicKey
fn from(sk: &PrivateKey) -> PublicKey
Given an X25519 private key, compute its corresponding public key.
source§impl From<PrivateKey> for StaticSecret
impl From<PrivateKey> for StaticSecret
source§fn from(sk: PrivateKey) -> Self
fn from(sk: PrivateKey) -> Self
Converts to this type from the input type.
source§impl From<StaticSecret> for PrivateKey
impl From<StaticSecret> for PrivateKey
Auto Trait Implementations§
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnwindSafe for PrivateKey
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> Base32Len for T
impl<T> Base32Len for T
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToBase32 for T
impl<T> ToBase32 for T
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
)