[][src]Enum socket_collection::DecryptContext

pub enum DecryptContext {
    Null,
    Authenticated {
        shared_key: SharedSecretKey,
    },
    AnonymousDecrypt {
        our_pk: PublicEncryptKey,
        our_sk: SecretEncryptKey,
    },
}

Simplifies decryption by holding the necessary context - keys to decrypt data. Allows "null" decryption where data is only deserialized. See: null object pattern.

Variants

No encryption.

Encryption + authentication

Fields of Authenticated

No message authentication. Only decrypt operation is allowed.

Fields of AnonymousDecrypt

Our private key.

Our secret key.

Methods

impl DecryptContext
[src]

Contructs "null" encryption context which actually does no encryption. In this case data is simply serialized but not encrypted.

Construct crypto context that encrypts and authenticate messages.

Constructs crypto context that is only meant for unauthenticated decryption.

Decrypt given buffer and deserialize into structure.

The length of encrypted size variable. The returned value must match EncryptContext::encrypted_size_len(), so that we could be able to decrypt it.

Trait Implementations

impl Clone for DecryptContext
[src]

Performs copy-assignment from source. Read more

impl Default for DecryptContext
[src]

Default is "null" encryption.

impl Debug for DecryptContext
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same for T

Should always be Self