Enum safe_app::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]
impl CipherOpt
pub fn encrypt(
&self,
plain_text: &[u8],
app_ctx: &AppContext
) -> Result<Vec<u8>, AppError>
[src]
pub fn encrypt(
&self,
plain_text: &[u8],
app_ctx: &AppContext
) -> Result<Vec<u8>, AppError>
Encrypt plain text
pub fn decrypt(
cipher_text: &[u8],
app_ctx: &AppContext,
client: &AppClient
) -> Result<Vec<u8>, AppError>
[src]
pub fn decrypt(
cipher_text: &[u8],
app_ctx: &AppContext,
client: &AppClient
) -> Result<Vec<u8>, AppError>
Decrypt something encrypted by CipherOpt::encrypt()