Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
crypto_base64.h
1#ifndef SOURCEMETA_CORE_CRYPTO_BASE64_H_
2#define SOURCEMETA_CORE_CRYPTO_BASE64_H_
3
4#ifndef SOURCEMETA_CORE_CRYPTO_EXPORT
5#include <sourcemeta/core/crypto_export.h>
6#endif
7
8#include <sourcemeta/core/crypto_secure.h>
9
10#include <cstdint> // std::uint8_t
11#include <optional> // std::optional
12#include <ostream> // std::ostream
13#include <span> // std::span
14#include <string> // std::string
15#include <string_view> // std::string_view
16
17namespace sourcemeta::core {
18
32auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_encode(const std::string_view input,
33 std::ostream &output) -> void;
34
44auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_encode(const std::string_view input)
45 -> std::string;
46
60auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_encode(const std::string_view input,
61 SecureString &output) -> void;
62
75auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_decode(const std::string_view input)
76 -> std::optional<std::string>;
77
93auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_decode(const std::string_view input,
94 SecureString &output) -> bool;
95
109auto SOURCEMETA_CORE_CRYPTO_EXPORT
110base64url_encode(const std::string_view input, std::ostream &output) -> void;
111
122auto SOURCEMETA_CORE_CRYPTO_EXPORT
123base64url_encode(const std::string_view input) -> std::string;
124
136auto SOURCEMETA_CORE_CRYPTO_EXPORT
137base64url_encode(std::span<const std::uint8_t> input) -> std::string;
138
152auto SOURCEMETA_CORE_CRYPTO_EXPORT
153base64url_encode(const std::string_view input, SecureString &output) -> void;
154
167auto SOURCEMETA_CORE_CRYPTO_EXPORT
168base64url_decode(const std::string_view input) -> std::optional<std::string>;
169
170} // namespace sourcemeta::core
171
172#endif
Definition crypto_secure.h:162
auto SOURCEMETA_CORE_CRYPTO_EXPORT base64url_decode(const std::string_view input) -> std::optional< std::string >
auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_encode(const std::string_view input, std::ostream &output) -> void
auto SOURCEMETA_CORE_CRYPTO_EXPORT base64url_encode(const std::string_view input, std::ostream &output) -> void
auto SOURCEMETA_CORE_CRYPTO_EXPORT base64_decode(const std::string_view input) -> std::optional< std::string >