Virgil Security Crypto library  1.8.2
VirgilChunkCipher.h
1 
37 #ifndef VIRGIL_CHUNK_CIPHER_H
38 #define VIRGIL_CHUNK_CIPHER_H
39 
40 #include <cstddef>
41 
42 #include <virgil/crypto/VirgilCipherBase.h>
43 #include <virgil/crypto/VirgilByteArray.h>
44 
45 namespace virgil { namespace crypto {
46 
53 public:
57  enum {
59  kPreferredChunkSize = 1024 * 1024 - 1
60  };
62 public:
67  size_t startEncryption(size_t preferredChunkSize = kPreferredChunkSize);
68 
74  const VirgilByteArray& recipientId, const VirgilByteArray& privateKey,
75  const VirgilByteArray& privateKeyPassword = VirgilByteArray());
76 
81  size_t startDecryptionWithPassword(const VirgilByteArray& pwd);
82 
87  VirgilByteArray process(const VirgilByteArray& data);
88 
93  void finish();
94 
98  virtual ~VirgilChunkCipher() throw();
99 
100 private:
104  void storeChunkSize(size_t chunkSize);
105 
109  size_t retrieveChunkSize() const;
110 };
111 
112 }}
113 
114 #endif /* VIRGIL_CHUNK_CIPHER_H */
This class provides high-level interface to encrypt / decrypt data splitted to chunks.
Definition: VirgilChunkCipher.h:52
size_t startDecryptionWithKey(const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
Initialize multipart decryption with given private key.
Definition: VirgilAsn1Compatible.h:46
VirgilByteArray process(const VirgilByteArray &data)
Encrypt / Decrypt given data chunk.
size_t startDecryptionWithPassword(const VirgilByteArray &pwd)
Initialize multipart decryption with given private key.
virtual ~VirgilChunkCipher()
Polymorphic destructor.
size_t startEncryption(size_t preferredChunkSize=kPreferredChunkSize)
Initialize data chunk encryption with given chunk size.
void finish()
Finalize encryption or decryption process.
1MiB - 1b for padding
Definition: VirgilChunkCipher.h:59
This class provides configuration methods to all Virgil*Cipher classes.
Definition: VirgilCipherBase.h:64