Virgil Security Crypto library  1.8.2
VirgilStreamCipher.h
1 
37 #ifndef VIRGIL_STREAM_CIPHER_H
38 #define VIRGIL_STREAM_CIPHER_H
39 
40 #include <virgil/crypto/VirgilCipherBase.h>
41 
42 #include <virgil/crypto/VirgilByteArray.h>
43 #include <virgil/crypto/VirgilDataSource.h>
44 #include <virgil/crypto/VirgilDataSink.h>
45 
46 namespace virgil { namespace crypto {
47 
52 public:
56  virtual ~VirgilStreamCipher() throw();
57 
58 public:
68  void encrypt(VirgilDataSource& source, VirgilDataSink& sink, bool embedContentInfo = false);
69 
76  void decryptWithKey(
77  VirgilDataSource& source, VirgilDataSink& sink, const VirgilByteArray& recipientId,
78  const VirgilByteArray& privateKey, const VirgilByteArray& privateKeyPassword = VirgilByteArray());
79 
86  void decryptWithPassword(VirgilDataSource& source, VirgilDataSink& sink, const VirgilByteArray& pwd);
87 
88 private:
93  VirgilByteArray tryReadContentInfo(VirgilDataSource& source);
94 
98  void decrypt(
99  VirgilDataSource& source, VirgilDataSink& sink,
100  virgil::crypto::foundation::VirgilSymmetricCipher& cipher, const VirgilByteArray& firstChunk);
101 };
102 
103 }}
104 
105 #endif /* VIRGIL_STREAM_CIPHER_H */
void decryptWithPassword(VirgilDataSource &source, VirgilDataSink &sink, const VirgilByteArray &pwd)
Decrypt data read from given source for recipient defined by password, and write it to the sink...
This is base class for output streams.
Definition: VirgilDataSink.h:49
Definition: VirgilAsn1Compatible.h:46
virtual ~VirgilStreamCipher()
Polymorphic destructor.
void encrypt(VirgilDataSource &source, VirgilDataSink &sink, bool embedContentInfo=false)
Encrypt data read from given source and write it the sink.
This class provides high-level interface to encrypt / decrypt streaming data using Virgil Security ke...
Definition: VirgilStreamCipher.h:51
Provides symmetric ciphers algorithms.
Definition: VirgilSymmetricCipher.h:57
This is base class for input streams.
Definition: VirgilDataSource.h:49
void decryptWithKey(VirgilDataSource &source, VirgilDataSink &sink, const VirgilByteArray &recipientId, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
Decrypt data read from given source for recipient defined by id and private key, and write it to the ...
This class provides configuration methods to all Virgil*Cipher classes.
Definition: VirgilCipherBase.h:64