Virgil Security Crypto library  2.6.3
Classes | Public Member Functions | Static Public Member Functions | List of all members
virgil::crypto::primitive::VirgilOperationCipher Class Reference

Define proxy interface for the Symmetric Cipher functionality. More...

#include <VirgilOperationCipher.h>

Public Member Functions

template<class Impl >
 VirgilOperationCipher (Impl impl)
 Captures implementation object. More...
 
size_t getKeySize () const
 Return size of the encryption/decryption key. More...
 
size_t getNonceSize () const
 Return size of the nonce. More...
 
VirgilByteArray encrypt (const VirgilByteArray &plainText, const VirgilByteArray &key, const VirgilByteArray &nonce, const VirgilByteArray &authData=VirgilByteArray()) const
 Encrypt given plain text. More...
 
VirgilByteArray decrypt (const VirgilByteArray &cipherText, const VirgilByteArray &key, const VirgilByteArray &nonce, const VirgilByteArray &authData=VirgilByteArray()) const
 Decrypt given cipher text. More...
 

Static Public Member Functions

static VirgilOperationCipher getDefault ()
 Return default implementation.
 

Detailed Description

Define proxy interface for the Symmetric Cipher functionality.

Note
This is experimental feature.

Constructor & Destructor Documentation

template<class Impl >
virgil::crypto::primitive::VirgilOperationCipher::VirgilOperationCipher ( Impl  impl)
inline

Captures implementation object.

Template Parameters
Impl- class that contains functions that has identical signature to this class functions.
Parameters
impl- object that implements interface.

Member Function Documentation

VirgilByteArray virgil::crypto::primitive::VirgilOperationCipher::decrypt ( const VirgilByteArray cipherText,
const VirgilByteArray key,
const VirgilByteArray nonce,
const VirgilByteArray authData = VirgilByteArray() 
) const
inline

Decrypt given cipher text.

Parameters
cipherText- encrypted data to be decrypted.
key- decryption key.
nonce- Nonce or IV (same as for encryption).
authData- additional data that participate in an authentication (same as for encryption).
Returns
Plain text.
VirgilByteArray virgil::crypto::primitive::VirgilOperationCipher::encrypt ( const VirgilByteArray plainText,
const VirgilByteArray key,
const VirgilByteArray nonce,
const VirgilByteArray authData = VirgilByteArray() 
) const
inline

Encrypt given plain text.

Parameters
plainText- data to be encrypted.
key- encryption key.
nonce- Nonce or IV.
authData- additional data that participate in an authentication.
Returns
Encrypted data (cipher text).
size_t virgil::crypto::primitive::VirgilOperationCipher::getKeySize ( ) const
inline

Return size of the encryption/decryption key.

Returns
Key size of in octets.
size_t virgil::crypto::primitive::VirgilOperationCipher::getNonceSize ( ) const
inline

Return size of the nonce.

Returns
None size in octets.

The documentation for this class was generated from the following file: