Struct blockify::AuthKeyPair
source · pub struct AuthKeyPair { /* private fields */ }Expand description
An AuthKeyPair is a cryptographic key pair that can be used for digital signing and verification.
Implementations§
source§impl AuthKeyPair
impl AuthKeyPair
pub fn new( private_key: Box<[u8]>, public_key: Box<[u8]>, algorithm: KeyPairAlgorithm ) -> AuthKeyPair
pub fn public_key_bytes(&self) -> &[u8] ⓘ
pub fn private_key_bytes(&self) -> &[u8] ⓘ
pub fn into_public_key(self) -> PublicKey
pub fn algorithm(&self) -> KeyPairAlgorithm
sourcepub fn sign(&self, msg: &[u8]) -> Result<DigitalSignature, SigningError>
pub fn sign(&self, msg: &[u8]) -> Result<DigitalSignature, SigningError>
Uses this AuthKeyPair to sign the given bytes returning a digital signature
Trait Implementations§
source§impl Clone for AuthKeyPair
impl Clone for AuthKeyPair
source§fn clone(&self) -> AuthKeyPair
fn clone(&self) -> AuthKeyPair
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 AuthKeyPair
impl Debug for AuthKeyPair
source§impl From<AuthKeyPair> for PublicKey
impl From<AuthKeyPair> for PublicKey
source§fn from(value: AuthKeyPair) -> Self
fn from(value: AuthKeyPair) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for AuthKeyPair
impl Send for AuthKeyPair
impl Sync for AuthKeyPair
impl Unpin for AuthKeyPair
impl UnwindSafe for AuthKeyPair
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