[][src]Enum safe_app::cipher_opt::CipherOpt

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]

pub fn encrypt(
    &self,
    plain_text: &[u8],
    app_ctx: &AppContext
) -> Result<Vec<u8>, AppError>
[src]

Encrypt plain text

pub fn decrypt(
    cipher_text: &[u8],
    app_ctx: &AppContext,
    client: &AppClient
) -> Result<Vec<u8>, AppError>
[src]

Decrypt something encrypted by CipherOpt::encrypt()

Trait Implementations

impl Debug for CipherOpt[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,