[][src]Struct yaca::SealContext

pub struct SealContext { /* fields omitted */ }

Context for Seal operations

Implementations

impl SealContext[src]

pub fn initialize(
    pub_key: &Key,
    algo: &EncryptAlgorithm,
    bcm: &BlockCipherMode,
    sym_key_length: &KeyLength
) -> Result<(SealContext, Key, Option<Key>)>
[src]

Initializes an asymmetric encryption context and generates symmetric key and Initialization Vector

  • pub_key is a key that the returned symmetric key will be encrypted with, it must be of KeyType::RsaPublic type.
  • algo is an encryption algorithm used to encrypt the data.
  • bcm is a chaining used to encrypt the data.
  • sym_key_length defines the length of a generated symmetric key, it must be at least 88 bits shorter than the pub_key bit length.
  • The function returns a tuple of context, generated and encrypted symmetric key and generated Initialization Vector of the default length for a given encryption configuration (or None).
  • The generated symmetric key is encrypted with public key, so can be only used with OpenContext::initialize(). It can be exported, but after import it can be only used with OpenContext::initialize() as well.

pub fn update(&self, plaintext: &[u8]) -> Result<Vec<u8>>[src]

Encrypts chunk of the data

  • plaintext is a chunk of data to be encrypted.
  • Returns a chunk of encrypted data.

pub fn finalize(&self) -> Result<Vec<u8>>[src]

Encrypts the final chunk of the data

  • Returns the final chunk of encrypted data.

Trait Implementations

impl ContextWithPadding for SealContext[src]

impl ContextWithRc2Supported for SealContext[src]

impl ContextWithXcmEncryptProperties for SealContext[src]

impl Drop for SealContext[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> From<T> for T[src]

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

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.