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
108auto SOURCEMETA_CORE_CRYPTO_EXPORT is_base64(const std::string_view input)
109 -> bool;
110
124auto SOURCEMETA_CORE_CRYPTO_EXPORT
125base64url_encode(const std::string_view input, std::ostream &output) -> void;
126
137auto SOURCEMETA_CORE_CRYPTO_EXPORT
138base64url_encode(const std::string_view input) -> std::string;
139
151auto SOURCEMETA_CORE_CRYPTO_EXPORT
152base64url_encode(std::span<const std::uint8_t> input) -> std::string;
153
167auto SOURCEMETA_CORE_CRYPTO_EXPORT
168base64url_encode(const std::string_view input, SecureString &output) -> void;
169
182auto SOURCEMETA_CORE_CRYPTO_EXPORT
183base64url_decode(const std::string_view input) -> std::optional<std::string>;
184
197auto SOURCEMETA_CORE_CRYPTO_EXPORT is_base64url(const std::string_view input)
198 -> bool;
199
200} // namespace sourcemeta::core
201
202#endif
Definition crypto_secure.h:165
auto SOURCEMETA_CORE_CRYPTO_EXPORT is_base64url(const std::string_view input) -> bool
auto SOURCEMETA_CORE_CRYPTO_EXPORT is_base64(const std::string_view input) -> bool
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 >