pub struct CryptoKeys { /* private fields */ }Expand description
Signing (private) and verifying (public)
key pair which can create and verify
SignatureBytes.
Implementations§
Source§impl CryptoKeys
impl CryptoKeys
Sourcepub fn from_private(private_key: PrivateKeyBytes) -> Result<Self, CryptoError>
pub fn from_private(private_key: PrivateKeyBytes) -> Result<Self, CryptoError>
Tries to load a pair of keys from
private_key.
Sourcepub fn into_private(self) -> PrivateKeyBytes
pub fn into_private(self) -> PrivateKeyBytes
Consumes these keys, returning only their private key.
Trait Implementations§
Source§impl CryptoSigns for CryptoKeys
impl CryptoSigns for CryptoKeys
Source§fn sign(&self, message: &[&[u8]]) -> Result<SignatureBytes, CryptoError>
fn sign(&self, message: &[&[u8]]) -> Result<SignatureBytes, CryptoError>
Signs
message with this signer’s private key,
returning Ok(signature) iff signing was successful.Source§impl CryptoVerifies for CryptoKeys
impl CryptoVerifies for CryptoKeys
Source§fn verify(
&self,
message: &[&[u8]],
signature: &SignatureBytes,
) -> Result<(), CryptoError>
fn verify( &self, message: &[&[u8]], signature: &SignatureBytes, ) -> Result<(), CryptoError>
Verifies
signature against message,
returning Ok iff the signature is
valid and corresponds to this verifier’s
public key.Source§impl HasCryptoPublicKey for CryptoKeys
impl HasCryptoPublicKey for CryptoKeys
Source§fn public_key_bytes(&self) -> PublicKeyBytes
fn public_key_bytes(&self) -> PublicKeyBytes
Returns this thing’s public key.
Auto Trait Implementations§
impl Freeze for CryptoKeys
impl RefUnwindSafe for CryptoKeys
impl Send for CryptoKeys
impl Sync for CryptoKeys
impl Unpin for CryptoKeys
impl UnsafeUnpin for CryptoKeys
impl UnwindSafe for CryptoKeys
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> TryAsFormat<T> for T
impl<T> TryAsFormat<T> for T
Source§type Error = Infallible
type Error = Infallible
Source§fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
fn try_as_format(&self) -> Result<&T, <T as TryAsFormat<T>>::Error>
Returns a
D-formatted reference to the data.