|
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
|
A parsed Ed25519 key (private, or public only for verification). Move-only. More...
#include <fastmm/net/crypto.hpp>
Public Member Functions | |
| Ed25519Key () noexcept=default | |
| ~Ed25519Key () | |
| Ed25519Key (Ed25519Key &&o) noexcept | |
| Ed25519Key & | operator= (Ed25519Key &&o) noexcept |
| Ed25519Key (const Ed25519Key &)=delete | |
| Ed25519Key & | operator= (const Ed25519Key &)=delete |
| bool | valid () const noexcept |
| bool | has_private () const noexcept |
| bool | sign (std::string_view data, std::span< std::uint8_t, kEd25519SignatureSize > out) const noexcept |
| Writes the 64-byte signature; false without a private key. | |
| std::size_t | sign_base64 (std::string_view data, std::span< char > out) const noexcept |
Base64 signature into out (>= kEd25519Base64Size); returns bytes written, 0 on failure. | |
| std::string | sign_base64 (std::string_view data) const |
| bool | verify (std::string_view data, std::span< const std::uint8_t > signature) const noexcept |
| bool | verify_base64 (std::string_view data, std::string_view signature) const noexcept |
Verifies a base64 signature (Binance's signature parameter). | |
| std::string | public_pem () const |
| "\--\---BEGIN PUBLIC KEY\--\---" PEM of the key (empty when invalid). | |
Static Public Member Functions | |
| static Ed25519Key | from_private_pem (std::string_view pem) |
| PKCS#8 "PRIVATE KEY" PEM. Not valid() if the PEM is not an Ed25519 private key. | |
| static Ed25519Key | from_public_pem (std::string_view pem) |
| SubjectPublicKeyInfo "PUBLIC KEY" PEM (what Binance asks for when registering the key). | |
A parsed Ed25519 key (private, or public only for verification). Move-only.
|
defaultnoexcept |
| fastmm::net::Ed25519Key::~Ed25519Key | ( | ) |
|
inlinenoexcept |
|
delete |
|
noexcept |
|
delete |
|
static |
PKCS#8 "PRIVATE KEY" PEM. Not valid() if the PEM is not an Ed25519 private key.
|
static |
SubjectPublicKeyInfo "PUBLIC KEY" PEM (what Binance asks for when registering the key).
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Writes the 64-byte signature; false without a private key.
|
noexcept |
Base64 signature into out (>= kEd25519Base64Size); returns bytes written, 0 on failure.
| std::string fastmm::net::Ed25519Key::sign_base64 | ( | std::string_view | data | ) | const |
|
noexcept |
|
noexcept |
Verifies a base64 signature (Binance's signature parameter).
| std::string fastmm::net::Ed25519Key::public_pem | ( | ) | const |
"\--\---BEGIN PUBLIC KEY\--\---" PEM of the key (empty when invalid).