Struct oasis_runtime_sdk::keymanager::KeyPair
pub struct KeyPair {
pub input_keypair: InputKeyPair,
pub state_key: StateKey,
pub checksum: Vec<u8>,
}
Expand description
A key pair managed by the key manager.
Fields§
§input_keypair: InputKeyPair
Input key pair (pk, sk)
state_key: StateKey
State encryption key
checksum: Vec<u8>
Checksum of the key manager state.
Implementations§
§impl KeyPair
impl KeyPair
pub fn generate_mock() -> KeyPair
pub fn generate_mock() -> KeyPair
Generate a new random key (for testing).
pub fn new(
pk: PublicKey,
sk: PrivateKey,
state_key: StateKey,
checksum: Vec<u8>,
) -> KeyPair
pub fn new( pk: PublicKey, sk: PrivateKey, state_key: StateKey, checksum: Vec<u8>, ) -> KeyPair
Create a KeyPair
.
pub fn from_public_key(pk: PublicKey, checksum: Vec<u8>) -> KeyPair
pub fn from_public_key(pk: PublicKey, checksum: Vec<u8>) -> KeyPair
Create a KeyPair
with only the public key.
Trait Implementations§
§impl Decode for KeyPair
impl Decode for KeyPair
§fn try_default() -> Result<KeyPair, DecodeError>
fn try_default() -> Result<KeyPair, DecodeError>
Try to decode from a missing/null/undefined value.
§fn try_from_cbor_value(value: Value) -> Result<KeyPair, DecodeError>
fn try_from_cbor_value(value: Value) -> Result<KeyPair, 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.§impl Encode for KeyPair
impl Encode for KeyPair
§fn into_cbor_value(self) -> Value
fn into_cbor_value(self) -> Value
Encode the type into a CBOR Value.
§impl EncodeAsMap for KeyPair
impl EncodeAsMap for KeyPair
§fn into_cbor_value_map(self) -> Valuewhere
Self: Sized,
fn into_cbor_value_map(self) -> Valuewhere
Self: Sized,
Encode the type into a CBOR Map.
§fn into_cbor_map(self) -> Vec<(Value, Value)>where
Self: Sized,
fn into_cbor_map(self) -> Vec<(Value, Value)>where
Self: Sized,
Encode the type into a CBOR Map, returning the map items.
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)