37 #ifndef VIRGIL_CRYPTO_TINY_CIPHER_H
38 #define VIRGIL_CRYPTO_TINY_CIPHER_H
42 #include <virgil/crypto/VirgilByteArray.h>
44 namespace virgil {
namespace crypto {
49 class VirgilTinyCipherImpl;
171 void encrypt(const VirgilByteArray& data, const VirgilByteArray& recipientPublicKey);
188 const VirgilByteArray& data, const VirgilByteArray& recipientPublicKey,
189 const VirgilByteArray& senderPrivateKey,
190 const VirgilByteArray& senderPrivateKeyPassword = VirgilByteArray());
212 VirgilByteArray
getPackage(
size_t index) const;
229 void addPackage(const VirgilByteArray& package);
252 const VirgilByteArray& recipientPrivateKey,
253 const VirgilByteArray& recipientPrivateKeyPassword = VirgilByteArray());
266 const VirgilByteArray& senderPublicKey,
267 const VirgilByteArray& recipientPrivateKey,
268 const VirgilByteArray& recipientPrivateKeyPassword = VirgilByteArray());
276 VirgilTinyCipherImpl* impl_;
281 #endif // VIRGIL_CRYPTO_TINY_CIPHER_H
Min.
Definition: VirgilTinyCipher.h:125
PackageSize
Constants that represents maximum number of bytes in one package.
Definition: VirgilTinyCipher.h:124
virtual ~VirgilTinyCipher()
Destroy pimpl class object.
VirgilByteArray getPackage(size_t index) const
Return specific package.
void encrypt(const VirgilByteArray &data, const VirgilByteArray &recipientPublicKey)
Encrypt data with given public key.
VirgilByteArray verifyAndDecrypt(const VirgilByteArray &senderPublicKey, const VirgilByteArray &recipientPrivateKey, const VirgilByteArray &recipientPrivateKeyPassword=VirgilByteArray())
Verify accumulated packages and then decrypt it.
VirgilTinyCipher(size_t packageSize=PackageSize_Short_SMS)
Init cipher with given maximum package size.
void addPackage(const VirgilByteArray &package)
Add package.
VirgilByteArray decrypt(const VirgilByteArray &recipientPrivateKey, const VirgilByteArray &recipientPrivateKeyPassword=VirgilByteArray())
Decrypt accumulated packages.
Definition: VirgilAsn1Compatible.h:46
Long SMS.
Definition: VirgilTinyCipher.h:127
Short SMS.
Definition: VirgilTinyCipher.h:126
void reset()
Prepare cipher for the next encryption.
This class aim is to minimize encryption output.
Definition: VirgilTinyCipher.h:118
bool isPackagesAccumulated() const
Define whether all packages was accumulated or not.
void encryptAndSign(const VirgilByteArray &data, const VirgilByteArray &recipientPublicKey, const VirgilByteArray &senderPrivateKey, const VirgilByteArray &senderPrivateKeyPassword=VirgilByteArray())
Encrypt data with given public key and sign package.
size_t getPackageCount() const
Return total package count.