5 // Check encryption shema in openssl
6 // * what about data length after decryption?
7 // * do we need reset EVP_CONTEXT_CTX before each decryption?
10 // the iv is for inicialization vector, in some special cases
11 // we may not be able to set up iv in constructor.
12 // For example KeyProvider will not know the iv, it may set only the
15 KeyAES(const RawBuffer &key, const RawBuffer &iv = RawBuffer());
17 KeyAES(const KeyAES &key);
19 KeyAES& operator=(const KeyAES &key);
20 KeyAES& operator=(KeyAES &&key);
22 // iv must be set to perform encrypt/decrypt operation
23 // iv may be set in constructor or directly in encrypt/decrypt operation
24 RawBuffer encrypt(const RawBuffer &data, const RawBuffer &iv = RawBuffer());
25 RawBuffer decrypt(const RawBuffer &data, const RawBuffer &iv = RawBuffer());
31 // TODO: should we keep key in plain text RawBuffer or in AES_KEY structure.