Struct indy_utils::keys::PrivateKey
source · pub struct PrivateKey {
pub key: Vec<u8>,
pub alg: KeyType,
}
Expand description
A raw signing key used for generating transaction signatures
Fields§
§key: Vec<u8>
§alg: KeyType
Implementations§
source§impl PrivateKey
impl PrivateKey
pub fn new<K: AsRef<[u8]>>(key: K, alg: Option<KeyType>) -> Self
pub fn generate(alg: Option<KeyType>) -> Result<Self, ConversionError>
pub fn from_seed(seed: &[u8]) -> Result<Self, ConversionError>
pub fn public_key(&self) -> Result<VerKey, ConversionError>
pub fn key_bytes(&self) -> Vec<u8>
pub fn key_exchange(&self) -> Result<Self, ConversionError>
pub fn sign<M: AsRef<[u8]>>( &self, message: M ) -> Result<Vec<u8>, ConversionError>
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 Debug for PrivateKey
impl Debug for PrivateKey
source§impl Drop for PrivateKey
impl Drop for PrivateKey
source§impl Hash for PrivateKey
impl Hash for PrivateKey
source§impl Ord for PrivateKey
impl Ord for PrivateKey
source§fn cmp(&self, other: &PrivateKey) -> Ordering
fn cmp(&self, other: &PrivateKey) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<PrivateKey> for PrivateKey
impl PartialEq<PrivateKey> for PrivateKey
source§fn eq(&self, other: &PrivateKey) -> bool
fn eq(&self, other: &PrivateKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PrivateKey> for PrivateKey
impl PartialOrd<PrivateKey> for PrivateKey
source§fn partial_cmp(&self, other: &PrivateKey) -> Option<Ordering>
fn partial_cmp(&self, other: &PrivateKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Validatable for PrivateKey
impl Validatable for PrivateKey
source§impl Zeroize for PrivateKey
impl Zeroize for PrivateKey
impl Eq for PrivateKey
impl StructuralEq for PrivateKey
impl StructuralPartialEq 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§
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