[−][src]Struct yaca::SealContext
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]
pub_key: &Key,
algo: &EncryptAlgorithm,
bcm: &BlockCipherMode,
sym_key_length: &KeyLength
) -> Result<(SealContext, Key, Option<Key>)>
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 ofKeyType::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 thepub_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 withOpenContext::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]
pub fn set_property_padding(&self, padding: &Padding) -> Result<()>
[src]
impl ContextWithRc2Supported for SealContext
[src]
pub fn set_property_rc2_effective_key_bits(
&self,
rc2_eff_key_bits: usize
) -> Result<()>
[src]
&self,
rc2_eff_key_bits: usize
) -> Result<()>
impl ContextWithXcmEncryptProperties for SealContext
[src]
pub fn set_property_ccm_aad(
&self,
ccm_aad: &[u8],
plaintext_len: usize
) -> Result<()>
[src]
&self,
ccm_aad: &[u8],
plaintext_len: usize
) -> Result<()>
pub fn set_property_gcm_tag_len(&self, gcm_tag_len: usize) -> Result<()>
[src]
pub fn get_property_gcm_tag(&self) -> Result<Vec<u8>>
[src]
pub fn set_property_gcm_aad(&self, gcm_aad: &[u8]) -> Result<()>
[src]
pub fn set_property_ccm_tag_len(&self, ccm_tag_len: usize) -> Result<()>
[src]
pub fn get_property_ccm_tag(&self) -> Result<Vec<u8>>
[src]
impl Drop for SealContext
[src]
Auto Trait Implementations
impl RefUnwindSafe for SealContext
impl !Send for SealContext
impl !Sync for SealContext
impl Unpin for SealContext
impl UnwindSafe for SealContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,