Encapsulates an Ed25519 key pair. More...
#include <DwmCredenceEd25519KeyPair.hh>
Public Member Functions | |
| Ed25519KeyPair (const std::string &id="") | |
| Default constructor. | |
| Ed25519KeyPair (const Ed25519KeyPair &)=default | |
| Copy constructor. | |
| ~Ed25519KeyPair () | |
| Destructor. Clears the contents of the keys before deallocation. | |
| const ShortString & | Id () const |
| Returns the owner of the keypair. | |
| const ShortString & | Id (const ShortString &id) |
| Sets and returns the owner of the keypair. | |
| const std::string & | PublicKey () const |
| Returns the public key. | |
| const std::string & | PublicKey (const std::string &publicKey) |
| Sets and returns the public key. | |
| const std::string & | SecretKey () const |
| Returns the secret key. | |
| const std::string & | SecretKey (const std::string &secretKey) |
| Sets and returns the secret key. | |
| bool | IsValid () const |
| Returns true if they keypair is valid (i.e. | |
| void | Clear () |
| Clears the contents of the key pair. | |
| bool | operator== (const Ed25519KeyPair &keyPair) const |
| operator == | |
Encapsulates an Ed25519 key pair.
The contained secret key is used to sign challenge responses during authentication. The contained public key is used to validate signatures in challenge responses during authentication.
A ShortString is used to hold the ID of the owner of the keypair. This is to help avoid memory resource DoS attacks on a server, where a length-encoded version of the ID will be received from a client during authentication. The keys themselves are never transmitted.
| Dwm::Credence::Ed25519KeyPair::Ed25519KeyPair | ( | const std::string & | id = "" | ) |
Default constructor.
Creates the contained public and secret keys using random data. If id is empty, an ID consisting of the local user name and hostname will be used (e.g. 'dwm@h.nosp@m.ost..nosp@m.org').
| bool Dwm::Credence::Ed25519KeyPair::IsValid | ( | ) | const |
Returns true if they keypair is valid (i.e.
can be used to sign messages).
| const std::string & Dwm::Credence::Ed25519KeyPair::PublicKey | ( | ) | const |
Returns the public key.
This is used to verify signatures in challenge responses during authentication.
| const std::string & Dwm::Credence::Ed25519KeyPair::SecretKey | ( | ) | const |
Returns the secret key.
This is used to sign challenge responses during authentication.