37 #ifndef VIRGIL_CIPHER_BASE_H
38 #define VIRGIL_CIPHER_BASE_H
43 #include <virgil/crypto/VirgilByteArray.h>
44 #include <virgil/crypto/VirgilCustomParams.h>
49 namespace virgil {
namespace crypto {
51 class VirgilCipherBaseImpl;
54 namespace virgil {
namespace crypto {
namespace foundation {
55 class VirgilSymmetricCipher;
59 namespace virgil {
namespace crypto {
84 void addKeyRecipient(
const VirgilByteArray& recipientId,
const VirgilByteArray& publicKey);
187 const VirgilByteArray& publicKey,
188 const VirgilByteArray& privateKey,
const VirgilByteArray& privateKeyPassword = VirgilByteArray());
221 const VirgilByteArray& encryptedDataInfo,
222 const VirgilByteArray& recipientId,
const VirgilByteArray& privateKey,
223 const VirgilByteArray& privateKeyPassword = VirgilByteArray());
240 const VirgilByteArray& recipientId,
241 const VirgilByteArray& privateKey,
const VirgilByteArray& privateKeyPassword);
273 VirgilCipherBaseImpl* impl_;
Data object that represent ASN.1 structure: VirgilCustomParams.
Definition: VirgilCustomParams.h:51
virgil::crypto::foundation::VirgilSymmetricCipher & initDecryption(const VirgilByteArray &encryptedDataInfo, const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
Configures symmetric cipher for encryption.
void addPasswordRecipient(const VirgilByteArray &pwd)
Add recipient defined with password.
void clearCipherInfo()
Clear all information related to the cipher.
Definition: VirgilAsn1Compatible.h:46
VirgilByteArray getContentInfo() const
Returns encrypted data info.
void addKeyRecipient(const VirgilByteArray &recipientId, const VirgilByteArray &publicKey)
Add recipient defined with id and public key.
virgil::crypto::foundation::VirgilSymmetricCipher & initDecryptionWithPassword(const VirgilByteArray &pwd)
Configures symmetric cipher for decryption based on the recipient's password.
VirgilByteArray tryReadContentInfo(const VirgilByteArray &encryptedData)
Make attempt to read content info from the encrypted data.
bool keyRecipientExists(const VirgilByteArray &recipientId) const
Check whether recipient with given identifier exists.
virgil::crypto::foundation::VirgilSymmetricCipher & initDecryptionWithKey(const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword)
Configures symmetric cipher for decryption based on the recipient's id and private key...
void removeAllRecipients()
Remove all recipients.
static VirgilByteArray computeShared(const VirgilByteArray &publicKey, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
Compute shared secret key on a given keys.
virgil::crypto::foundation::VirgilSymmetricCipher & getSymmetricCipher()
Return symmetric cipher configure by one of the methods: initEncryption(), initDecryptionWithPassword...
virgil::crypto::foundation::VirgilSymmetricCipher & initEncryption()
Configures symmetric cipher for encryption.
void setContentInfo(const VirgilByteArray &contentInfo)
Create content info object from ASN.1 structure.
Provides symmetric ciphers algorithms.
Definition: VirgilSymmetricCipher.h:57
void removePasswordRecipient(const VirgilByteArray &pwd)
Remove recipient with given password.
void buildContentInfo()
Build VirgilContentInfo object.
void removeKeyRecipient(const VirgilByteArray &recipientId)
Remove recipient with given id.
virtual ~VirgilCipherBase()
Dispose used resources.
This class provides configuration methods to all Virgil*Cipher classes.
Definition: VirgilCipherBase.h:64
VirgilCipherBase()
Initialize randomization module used by encryption.
static size_t defineContentInfoSize(const VirgilByteArray &data)
Read content info size as part of the data.