10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
Ciphers.h
1
#ifndef TENDUKE_CRYPTO_CIPHERS_H
2
#define TENDUKE_CRYPTO_CIPHERS_H
3
4
#include "./Cipher.h"
5
#include "../utl/BinaryData.h"
6
#include "../utl/DataSpan.h"
7
#include "../utl/DataSink.h"
8
#include <memory>
9
#include <string>
10
11
namespace
tenduke
{
namespace
crypto
{
12
19
class
Ciphers
20
{
21
public
:
22
virtual
~Ciphers
() =
default
;
23
34
virtual
std::unique_ptr<::tenduke::utl::BinaryData>
decrypt
(
35
const ::tenduke::utl::DataSpan &ciphertext,
36
const ::tenduke::utl::DataSpan &encryptionKey
37
)
const
= 0;
38
49
virtual
std::string
decryptString
(
50
const ::tenduke::utl::DataSpan &ciphertext,
51
const ::tenduke::utl::DataSpan &encryptionKey
52
)
const
= 0;
53
62
virtual
std::string
decryptString
(
63
const ::tenduke::crypto::Cipher &cipher,
64
const ::tenduke::utl::DataSpan &ciphertext
65
)
const
= 0;
66
75
virtual
void
encrypt
(
76
const ::tenduke::crypto::Cipher &cipher,
77
const ::tenduke::utl::DataSpan &plaintext,
78
::tenduke::utl::DataSink
&ciphertext
79
)
const
= 0;
80
91
virtual
std::unique_ptr<::tenduke::utl::BinaryData>
encrypt
(
92
const ::tenduke::utl::DataSpan &plaintext,
93
const ::tenduke::utl::DataSpan &encryptionKey
94
)
const
= 0;
95
106
virtual
std::unique_ptr<::tenduke::utl::BinaryData>
encrypt
(
107
const
std::string &plaintext,
108
const ::tenduke::utl::DataSpan &encryptionKey
109
)
const
= 0;
110
};
111
112
}}
113
114
#endif
//TENDUKE_CRYPTO_CIPHERS_H
tenduke::crypto::Ciphers
A "service locator" for cipher-related operations.
Definition
Ciphers.h:20
tenduke::crypto::Ciphers::decrypt
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).
tenduke::crypto::Ciphers::decryptString
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.
tenduke::crypto::Ciphers::encrypt
virtual void encrypt(const ::tenduke::crypto::Cipher &cipher, const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const =0
Encrypts data with the given cipher.
tenduke::crypto::Ciphers::decryptString
virtual std::string decryptString(const ::tenduke::crypto::Cipher &cipher, const ::tenduke::utl::DataSpan &ciphertext) const =0
Decrypts given data using the given cipher to a string.
tenduke::crypto::Ciphers::encrypt
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).
tenduke::crypto::Ciphers::encrypt
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).
tenduke::utl::DataSink
A sink to which binary data can be appended.
Definition
DataSink.h:14
tenduke::crypto
Cryptography services.
Definition
AbstractCiphers.h:18
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
core
src
crypto
Ciphers.h
Generated by
1.17.0