Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
crypto_rsa_oaep.h
1#ifndef SOURCEMETA_CORE_CRYPTO_RSA_OAEP_H_
2#define SOURCEMETA_CORE_CRYPTO_RSA_OAEP_H_
3
4#ifndef SOURCEMETA_CORE_CRYPTO_EXPORT
5#include <sourcemeta/core/crypto_export.h>
6#endif
7
8#include <sourcemeta/core/crypto_sign.h>
9#include <sourcemeta/core/crypto_verify.h>
10
11#include <cstdint> // std::uint8_t
12#include <optional> // std::optional
13#include <string> // std::string
14#include <string_view> // std::string_view
15
16namespace sourcemeta::core {
17
21enum class RSAOAEPHash : std::uint8_t {
26};
27
42auto SOURCEMETA_CORE_CRYPTO_EXPORT rsa_oaep_encrypt(
43 const PublicKey &key, const RSAOAEPHash hash,
44 const std::string_view plaintext) -> std::optional<std::string>;
45
60auto SOURCEMETA_CORE_CRYPTO_EXPORT rsa_oaep_decrypt(
61 const PrivateKey &key, const RSAOAEPHash hash,
62 const std::string_view ciphertext) -> std::optional<std::string>;
63
64} // namespace sourcemeta::core
65
66#endif
Definition crypto_sign.h:33
Definition crypto_verify.h:62
auto SOURCEMETA_CORE_CRYPTO_EXPORT rsa_oaep_decrypt(const PrivateKey &key, const RSAOAEPHash hash, const std::string_view ciphertext) -> std::optional< std::string >
RSAOAEPHash
Definition crypto_rsa_oaep.h:21
auto SOURCEMETA_CORE_CRYPTO_EXPORT rsa_oaep_encrypt(const PublicKey &key, const RSAOAEPHash hash, const std::string_view plaintext) -> std::optional< std::string >
@ SHA1
The SHA-1 hash function, selecting RSA-OAEP.
Definition crypto_rsa_oaep.h:23
@ SHA256
The SHA-256 hash function, selecting RSA-OAEP-256.
Definition crypto_rsa_oaep.h:25