10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
Ciphers.h
1#ifndef TENDUKE_CRYPTO_CIPHERS_H
2#define TENDUKE_CRYPTO_CIPHERS_H
3
4#include "../utl/BinaryData.h"
5#include "../utl/DataSpan.h"
6#include <memory>
7#include <string>
8
9namespace tenduke { namespace crypto {
10
18{
19public:
20 virtual ~Ciphers() = default;
21
32 virtual std::unique_ptr<::tenduke::utl::BinaryData> decrypt(
33 const ::tenduke::utl::DataSpan &ciphertext,
34 const ::tenduke::utl::DataSpan &encryptionKey
35 ) const = 0;
36
47 virtual std::string decryptString(
48 const ::tenduke::utl::DataSpan &ciphertext,
49 const ::tenduke::utl::DataSpan &encryptionKey
50 ) const = 0;
51
62 virtual std::unique_ptr<::tenduke::utl::BinaryData> encrypt(
63 const ::tenduke::utl::DataSpan &plaintext,
64 const ::tenduke::utl::DataSpan &encryptionKey
65 ) const = 0;
66
77 virtual std::unique_ptr<::tenduke::utl::BinaryData> encrypt(
78 const std::string &plaintext,
79 const ::tenduke::utl::DataSpan &encryptionKey
80 ) const = 0;
81};
82
83}}
84
85#endif //TENDUKE_CRYPTO_CIPHERS_H
A "service locator" for cipher-related operations.
Definition Ciphers.h:18
virtual std::unique_ptr<::tenduke::utl::BinaryData > decrypt(const ::tenduke::utl::DataSpan &ciphertext, const ::tenduke::utl::DataSpan &encryptionKey) const =0
Decrypts given data using the system default cipher (AES256 GCM).
virtual std::string decryptString(const ::tenduke::utl::DataSpan &ciphertext, const ::tenduke::utl::DataSpan &encryptionKey) const =0
Decrypts given data using the system default cipher (AES256 GCM) to a string.
virtual std::unique_ptr<::tenduke::utl::BinaryData > encrypt(const ::tenduke::utl::DataSpan &plaintext, const ::tenduke::utl::DataSpan &encryptionKey) const =0
Encrypts given data using the system default cipher (AES256 GCM).
virtual std::unique_ptr<::tenduke::utl::BinaryData > encrypt(const std::string &plaintext, const ::tenduke::utl::DataSpan &encryptionKey) const =0
Encrypts given data using the system default cipher (AES256 GCM).
Cryptography services.
Definition AbstractCiphers.h:12
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4