37 #ifndef VIRGIL_CIPHER_BASE_H
38 #define VIRGIL_CIPHER_BASE_H
44 #include <virgil/crypto/VirgilByteArray.h>
45 #include <virgil/crypto/VirgilCustomParams.h>
50 namespace virgil {
namespace crypto {
namespace foundation {
52 class VirgilSymmetricCipher;
56 namespace virgil {
namespace crypto {
297 std::unique_ptr<Impl> 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.
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:53
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.
bool passwordRecipientExists(const VirgilByteArray &password) const
Check whether recipient with given password exists.
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:52
void removePasswordRecipient(const VirgilByteArray &pwd)
Remove recipient with given password.
void buildContentInfo()
Build VirgilContentInfo object.
VirgilCustomParams & customParams()
Provide access to the object that handles custom parameters.
void removeKeyRecipient(const VirgilByteArray &recipientId)
Remove recipient with given identifier.
This class provides configuration methods to all Virgil*Cipher classes.
Definition: VirgilCipherBase.h:61
VirgilCipherBase()
Initialize submodules.
static size_t defineContentInfoSize(const VirgilByteArray &data)
Read content info size as part of the data.