pub struct EncryptingKeypair {
pub secret: SecretKey,
pub public: PublicKey,
}
Expand description
Keypair that can be used for encryption. See crypto-box crate for details.
Fields
secret: SecretKey
public: PublicKey
Implementations
sourceimpl EncryptingKeypair
impl EncryptingKeypair
pub fn from_bytes_slices(pubkey: [u8; 32], seckey: [u8; 32]) -> Self
pub fn from_str(public_key: &str, secret_key: &str) -> Result<Self, CryptoError>
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a randomly generated (non-deterministic) encryption keypair. This keypair can be used as Single-use Transient Encryption Keypair (STEK).
pub fn encode_pub(&self) -> String
pub fn decrypt(&self, cipher_text: Vec<u8>) -> Result<Vec<u8>, CryptoError>
Trait Implementations
sourceimpl Debug for EncryptingKeypair
impl Debug for EncryptingKeypair
Auto Trait Implementations
impl RefUnwindSafe for EncryptingKeypair
impl Send for EncryptingKeypair
impl Sync for EncryptingKeypair
impl Unpin for EncryptingKeypair
impl UnwindSafe for EncryptingKeypair
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more