Virgil Security Crypto library  2.6.3
Public Member Functions | List of all members
virgil::crypto::VirgilSeqCipher Class Reference

This class provides high-level interface to sequenctially encrypt / decrypt data using Virgil Security keys. More...

#include <VirgilSeqCipher.h>

Inheritance diagram for virgil::crypto::VirgilSeqCipher:
virgil::crypto::VirgilCipherBase

Public Member Functions

VirgilByteArray startEncryption ()
 Start sequential encryption process. More...
 
void startDecryptionWithKey (const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
 Start sequential decryption for recipient defined by id and private key. More...
 
void startDecryptionWithPassword (const VirgilByteArray &pwd)
 Start sequential decryption for recipient defined by id and private key. More...
 
VirgilByteArray process (const VirgilByteArray &data)
 
VirgilByteArray finish ()
 
- Public Member Functions inherited from virgil::crypto::VirgilCipherBase
 VirgilCipherBase ()
 Initialize submodules.
 
void addKeyRecipient (const VirgilByteArray &recipientId, const VirgilByteArray &publicKey)
 Add recipient defined with id and public key. More...
 
void removeKeyRecipient (const VirgilByteArray &recipientId)
 Remove recipient with given identifier. More...
 
bool keyRecipientExists (const VirgilByteArray &recipientId) const
 Check whether recipient with given identifier exists. More...
 
void addPasswordRecipient (const VirgilByteArray &pwd)
 Add recipient defined with password. More...
 
void removePasswordRecipient (const VirgilByteArray &pwd)
 Remove recipient with given password. More...
 
bool passwordRecipientExists (const VirgilByteArray &password) const
 Check whether recipient with given password exists. More...
 
void removeAllRecipients ()
 Remove all recipients.
 
VirgilCustomParamscustomParams ()
 Provide access to the object that handles custom parameters. More...
 
const VirgilCustomParamscustomParams () const
 Provide readonly access to the object that handles custom parameters. More...
 
VirgilByteArray getContentInfo () const
 Return content info. More...
 
void setContentInfo (const VirgilByteArray &contentInfo)
 Create content info object from ASN.1 structure. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from virgil::crypto::VirgilCipherBase
static VirgilByteArray computeShared (const VirgilByteArray &publicKey, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
 Compute shared secret key on a given keys. More...
 
static size_t defineContentInfoSize (const VirgilByteArray &data)
 Read content info size as part of the data. More...
 
- Protected Member Functions inherited from virgil::crypto::VirgilCipherBase
VirgilByteArray filterAndSetupContentInfo (const VirgilByteArray &encryptedData, bool isLastChunk)
 Extract content info from the encrypted data and setup it. More...
 
void initEncryption ()
 Configures symmetric cipher for encryption. More...
 
void initDecryptionWithPassword (const VirgilByteArray &pwd)
 Stores recipient's password that is used for cipher's key decryption when content becomes available. More...
 
void initDecryptionWithKey (const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword)
 Stores recipient's information that is used for cipher's key decryption when content becomes available. More...
 
bool isInited () const
 
bool isReadyForEncryption () const
 
bool isReadyForDecryption () const
 
virgil::crypto::foundation::VirgilSymmetricCiphergetSymmetricCipher ()
 Return symmetric cipher configure by one of the methods: initEncryption(), initDecryptionWithPassword(), initDecryptionWithKey.
 
void buildContentInfo ()
 Build VirgilContentInfo object. More...
 
void clear ()
 Clear all information related to the cipher. More...
 

Detailed Description

This class provides high-level interface to sequenctially encrypt / decrypt data using Virgil Security keys.

Member Function Documentation

VirgilByteArray virgil::crypto::VirgilSeqCipher::finish ( )

Accomplish sequential encryption or decryption depends on the mode.

Returns
plain text, if cipher in the decryption mode, encrypted data, if cipher in the encryption mode.
VirgilByteArray virgil::crypto::VirgilSeqCipher::process ( const VirgilByteArray data)

Encrypt or decrypt given data depends on the current sequential mode.

Parameters
data- plain text, if cipher in the encryption mode, encrypted data, if cipher in the decryption mode.
Returns
plain text, if cipher in the decryption mode, encrypted data, if cipher in the encryption mode.
void virgil::crypto::VirgilSeqCipher::startDecryptionWithKey ( const VirgilByteArray recipientId,
const VirgilByteArray privateKey,
const VirgilByteArray privateKeyPassword = VirgilByteArray() 
)

Start sequential decryption for recipient defined by id and private key.

Note
Content info MUST be defined, if it was not embedded to the encrypted data.
See also
method setContentInfo().
void virgil::crypto::VirgilSeqCipher::startDecryptionWithPassword ( const VirgilByteArray pwd)

Start sequential decryption for recipient defined by id and private key.

Note
Content info MUST be defined, if it was not embedded to the encrypted data.
See also
method setContentInfo().
VirgilByteArray virgil::crypto::VirgilSeqCipher::startEncryption ( )

Start sequential encryption process.

Note
Store content info to use it for decryption process, or use it as beginning of encrypted data (embedding).
Returns
Content info.

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