[][src]Enum socket_collection::EncryptContext

pub enum EncryptContext {
    Null,
    Authenticated {
        shared_key: SharedSecretKey,
    },
    AnonymousEncrypt {
        their_pk: PublicEncryptKey,
    },
}

Simplifies encryption by holding the necessary context - encryption keys. Allows "null" encryption where data is only serialized. See: null object pattern.

Variants

No encryption.

Encryption + authentication

Fields of Authenticated

No message authentication. Only encrypt operation is allowed.

Fields of AnonymousEncrypt

Their public key.

Methods

impl EncryptContext
[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 encryption.

Serialize given structure and encrypt it.

Our data size is 32 bit number. When we encrypt this number with safe_crypto, we get a constant size byte array. This size depends on encryption variation though.

Trait Implementations

impl Clone for EncryptContext
[src]

Performs copy-assignment from source. Read more

impl Default for EncryptContext
[src]

Default is "null" encryption.

impl Debug for EncryptContext
[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