1#ifndef SOURCEMETA_CORE_CRYPTO_SIGN_H_
2#define SOURCEMETA_CORE_CRYPTO_SIGN_H_
4#ifndef SOURCEMETA_CORE_CRYPTO_EXPORT
5#include <sourcemeta/core/crypto_export.h>
8#include <sourcemeta/core/crypto_verify.h>
15namespace sourcemeta::core {
36 enum class Type : std::uint8_t {
53 [[nodiscard]]
auto type() const noexcept ->
Type;
61 [[nodiscard]] auto
internal() const noexcept -> const Internal * {
62 return this->internal_;
76 -> std::optional<PrivateKey>;
85 const std::string_view coordinate_x,
const std::string_view coordinate_y)
86 -> std::optional<PrivateKey>;
100auto SOURCEMETA_CORE_CRYPTO_EXPORT
106auto SOURCEMETA_CORE_CRYPTO_EXPORT
108 -> std::optional<PrivateKey>;
118 const std::string_view modulus,
const std::string_view public_exponent,
119 const std::string_view private_exponent,
const std::string_view prime1,
120 const std::string_view prime2,
const std::string_view exponent1,
121 const std::string_view exponent2,
const std::string_view coefficient)
122 -> std::optional<PrivateKey>;
140 -> std::optional<PublicKey>;
158 const std::string_view message) -> std::optional<std::string>;
175auto SOURCEMETA_CORE_CRYPTO_EXPORT
177 const std::string_view message) -> std::optional<std::string>;
198 const std::string_view message)
199 -> std::optional<std::string>;
216 const std::string_view message)
217 -> std::optional<std::string>;
PrivateKey(PrivateKey &&other) noexcept
Move constructor.
auto type() const noexcept -> Type
The kind of key this is.
auto internal() const noexcept -> const Internal *
Definition crypto_sign.h:61
Type
The kind of key, which fixes the signature schemes it can produce.
Definition crypto_sign.h:36
auto SOURCEMETA_CORE_CRYPTO_EXPORT derive_public_key(const PrivateKey &key) -> std::optional< PublicKey >
auto SOURCEMETA_CORE_CRYPTO_EXPORT eddsa_sign(const PrivateKey &key, const std::string_view message) -> std::optional< std::string >
auto SOURCEMETA_CORE_CRYPTO_EXPORT rsassa_pkcs1_v15_sign(const PrivateKey &key, const SignatureHashFunction hash, const std::string_view message) -> std::optional< std::string >
auto SOURCEMETA_CORE_CRYPTO_EXPORT make_edwards_private_key(const EdwardsCurve curve, const std::string_view seed) -> std::optional< PrivateKey >
auto SOURCEMETA_CORE_CRYPTO_EXPORT make_private_key(const std::string_view pem) -> std::optional< PrivateKey >
EllipticCurve
Definition crypto_verify.h:28
auto SOURCEMETA_CORE_CRYPTO_EXPORT make_rsa_private_key(const std::string_view modulus, const std::string_view public_exponent, const std::string_view private_exponent, const std::string_view prime1, const std::string_view prime2, const std::string_view exponent1, const std::string_view exponent2, const std::string_view coefficient) -> std::optional< PrivateKey >
auto SOURCEMETA_CORE_CRYPTO_EXPORT ecdsa_sign(const PrivateKey &key, const SignatureHashFunction hash, const std::string_view message) -> std::optional< std::string >
SignatureHashFunction
Definition crypto_verify.h:17
EdwardsCurve
Definition crypto_verify.h:39
auto SOURCEMETA_CORE_CRYPTO_EXPORT generate_ec_private_key(const EllipticCurve curve) -> std::optional< PrivateKey >
auto SOURCEMETA_CORE_CRYPTO_EXPORT rsassa_pss_sign(const PrivateKey &key, const SignatureHashFunction hash, const std::string_view message) -> std::optional< std::string >
auto SOURCEMETA_CORE_CRYPTO_EXPORT make_ec_private_key(const EllipticCurve curve, const std::string_view scalar, const std::string_view coordinate_x, const std::string_view coordinate_y) -> std::optional< PrivateKey >