Enum safe_app::ffi::cipher_opt::CipherOpt
[−]
[src]
pub enum CipherOpt { PlainText, Symmetric, Asymmetric { peer_encrypt_key: PublicKey, }, }
Cipher Options
Variants
PlainText
No encryption
Symmetric
Encrypt using symmetric keys (usually for private data)
Asymmetric
Encrypt using asymmetric encryption (encrypting for peer to read)
Fields of Asymmetric
peer_encrypt_key: PublicKey | PublicKey of the peer to whom we want to encrypt |
Methods
impl CipherOpt
[src]
fn encrypt(
&self,
plain_text: &[u8],
app_ctx: &AppContext
) -> Result<Vec<u8>, AppError>
[src]
&self,
plain_text: &[u8],
app_ctx: &AppContext
) -> Result<Vec<u8>, AppError>
Encrypt plain text
fn decrypt(
cipher_text: &[u8],
app_ctx: &AppContext,
client: &Client<AppContext>
) -> Result<Vec<u8>, AppError>
[src]
cipher_text: &[u8],
app_ctx: &AppContext,
client: &Client<AppContext>
) -> Result<Vec<u8>, AppError>
Decrypt something encrypted by CipherOpt::encrypt()