1#ifndef LIBFILEZILLA_SIGNATURE_HEADER
2#define LIBFILEZILLA_SIGNATURE_HEADER
29 explicit operator bool()
const {
30 return key_.size() == key_size;
34 return key_ == rhs.key_;
38 return !(*
this == rhs);
42 return key_ < rhs.key_;
45 std::string to_base64()
const;
48 std::vector<uint8_t> key_;
65 explicit operator bool()
const {
66 return key_.size() == key_size;
72 std::vector<uint8_t>
const& data()
const {
76 std::string to_base64()
const;
80 std::vector<uint8_t> key_;
88std::vector<uint8_t> FZ_PUBLIC_SYMBOL
sign(std::vector<uint8_t>
const& message,
private_signing_key const& priv,
bool include_message =
true);
89std::vector<uint8_t> FZ_PUBLIC_SYMBOL
sign(std::string_view
const& message,
private_signing_key const& priv,
bool include_message =
true);
90std::vector<uint8_t> FZ_PUBLIC_SYMBOL
sign(uint8_t
const* message,
size_t const size,
private_signing_key const& priv,
bool include_message =
true);
100bool FZ_PUBLIC_SYMBOL
verify(uint8_t
const* message,
size_t const message_size, uint8_t
const* signature,
size_t const sig_size,
public_verification_key const& pub);
Represents a private key to sign message with using Ed25519.
Definition signature.hpp:56
static private_signing_key generate()
Generates a random private key.
public_verification_key pubkey() const
Gets the public key corresponding to the private key.
Represents a public key to verify messages signed using Ed25519.
Definition signature.hpp:23
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition apply.hpp:17
bool verify(std::vector< uint8_t > const &message, public_verification_key const &pub)
Verify a message with attached signature. Returns true iff it has been signed by the private key corr...
std::vector< uint8_t > sign(std::vector< uint8_t > const &message, private_signing_key const &priv, bool include_message=true)
Returns the message with the signature appended, created using the passed private key.