Struct wildland_corex::EncryptingKeypair
source · [−]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]) -> EncryptingKeypair
pub fn from_str(
public_key: &str,
secret_key: &str
) -> Result<EncryptingKeypair, CryptoError>
sourcepub fn new() -> EncryptingKeypair
pub fn new() -> EncryptingKeypair
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, Global>
) -> Result<Vec<u8, Global>, CryptoError>
Trait Implementations
sourceimpl Debug for EncryptingKeypair
impl Debug for EncryptingKeypair
sourceimpl Default for EncryptingKeypair
impl Default for EncryptingKeypair
sourcefn default() -> EncryptingKeypair
fn default() -> EncryptingKeypair
Returns the “default value” for a type. Read more
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