Struct bc_components::PrivateKeyBase
source · pub struct PrivateKeyBase(/* private fields */);Expand description
Holds unique data from which keys for signing and encryption can be derived.
Implementations§
source§impl PrivateKeyBase
impl PrivateKeyBase
sourcepub fn from_optional_data(data: Option<impl Into<Bytes>>) -> Self
pub fn from_optional_data(data: Option<impl Into<Bytes>>) -> Self
Restores a PrivateKeyBase from an optional reference to a vector of bytes.
If the data is None, a new random PrivateKeyBase is generated.
sourcepub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
pub fn new_using(rng: &mut impl RandomNumberGenerator) -> Self
Generate a new random PrivateKeyBase using the given random number generator.
sourcepub fn new_with_provider(provider: impl PrivateKeysDataProvider) -> Self
pub fn new_with_provider(provider: impl PrivateKeysDataProvider) -> Self
Create a new PrivateKeyBase from the given private keys data provider.
sourcepub fn signing_private_key(&self) -> SigningPrivateKey
pub fn signing_private_key(&self) -> SigningPrivateKey
Derive a new SigningPrivateKey from this PrivateKeyBase.
sourcepub fn agreement_private_key(&self) -> AgreementPrivateKey
pub fn agreement_private_key(&self) -> AgreementPrivateKey
Derive a new AgreementPrivateKey from this PrivateKeyBase.
sourcepub fn public_keys(&self) -> PublicKeyBase
pub fn public_keys(&self) -> PublicKeyBase
Derive a new PublicKeyBase from this PrivateKeyBase.
This is a Schnorr public key for signing.
sourcepub fn ecdsa_public_keys(&self) -> PublicKeyBase
pub fn ecdsa_public_keys(&self) -> PublicKeyBase
Derive a new PublicKeyBase from this PrivateKeyBase.
This is an ECDSA public key for signing.
Trait Implementations§
source§impl AsRef<[u8]> for PrivateKeyBase
impl AsRef<[u8]> for PrivateKeyBase
source§impl AsRef<PrivateKeyBase> for PrivateKeyBase
impl AsRef<PrivateKeyBase> for PrivateKeyBase
source§fn as_ref(&self) -> &PrivateKeyBase
fn as_ref(&self) -> &PrivateKeyBase
Converts this type into a shared reference of the (usually inferred) input type.
source§impl CBORDecodable for PrivateKeyBase
impl CBORDecodable for PrivateKeyBase
source§impl CBOREncodable for PrivateKeyBase
impl CBOREncodable for PrivateKeyBase
source§impl CBORTagged for PrivateKeyBase
impl CBORTagged for PrivateKeyBase
source§impl CBORTaggedDecodable for PrivateKeyBase
impl CBORTaggedDecodable for PrivateKeyBase
source§fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for PrivateKeyBase
impl CBORTaggedEncodable for PrivateKeyBase
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl Clone for PrivateKeyBase
impl Clone for PrivateKeyBase
source§fn clone(&self) -> PrivateKeyBase
fn clone(&self) -> PrivateKeyBase
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 Debug for PrivateKeyBase
impl Debug for PrivateKeyBase
source§impl Default for PrivateKeyBase
impl Default for PrivateKeyBase
source§impl<'a> From<&'a PrivateKeyBase> for &'a [u8]
impl<'a> From<&'a PrivateKeyBase> for &'a [u8]
source§fn from(value: &'a PrivateKeyBase) -> Self
fn from(value: &'a PrivateKeyBase) -> Self
Converts to this type from the input type.
source§impl From<PrivateKeyBase> for CBOR
impl From<PrivateKeyBase> for CBOR
source§fn from(value: PrivateKeyBase) -> Self
fn from(value: PrivateKeyBase) -> Self
Converts to this type from the input type.
source§impl PartialEq for PrivateKeyBase
impl PartialEq for PrivateKeyBase
source§fn eq(&self, other: &PrivateKeyBase) -> bool
fn eq(&self, other: &PrivateKeyBase) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl TryFrom<&CBOR> for PrivateKeyBase
impl TryFrom<&CBOR> for PrivateKeyBase
source§impl TryFrom<CBOR> for PrivateKeyBase
impl TryFrom<CBOR> for PrivateKeyBase
source§impl URDecodable for PrivateKeyBase
impl URDecodable for PrivateKeyBase
source§impl UREncodable for PrivateKeyBase
impl UREncodable for PrivateKeyBase
impl Eq for PrivateKeyBase
impl StructuralEq for PrivateKeyBase
impl StructuralPartialEq for PrivateKeyBase
impl URCodable for PrivateKeyBase
Auto Trait Implementations§
impl RefUnwindSafe for PrivateKeyBase
impl Send for PrivateKeyBase
impl Sync for PrivateKeyBase
impl Unpin for PrivateKeyBase
impl UnwindSafe for PrivateKeyBase
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> 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)