#include <crypto.h>
|
| | PrivateKey (gnutls_x509_privkey_t k) |
| |
|
| PrivateKey (PrivateKey &&o) noexcept |
| |
|
PrivateKey & | operator= (PrivateKey &&o) noexcept |
| |
|
| PrivateKey (const uint8_t *src, size_t src_size, const char *password=nullptr) |
| |
|
| PrivateKey (const Blob &src, const std::string &password={}) |
| |
|
| operator bool () const |
| |
|
const PublicKey & | getPublicKey () const |
| |
|
const std::shared_ptr< PublicKey > & | getSharedPublicKey () const |
| |
|
int | serialize (uint8_t *out, size_t *out_len, const std::string &password={}) const |
| |
|
Blob | serialize (const std::string &password={}) const |
| |
| Blob | sign (const uint8_t *data, size_t data_len) const |
| |
|
Blob | sign (const Blob &dat) const |
| |
| Blob | decrypt (const uint8_t *cypher, size_t cypher_len) const |
| |
|
Blob | decrypt (const Blob &cypher) const |
| |
|
|
gnutls_privkey_t | key {} |
| |
|
gnutls_x509_privkey_t | x509_key {} |
| |
A private key, including the corresponding public key.
Definition at line 149 of file crypto.h.
◆ PrivateKey()
| dht::crypto::PrivateKey::PrivateKey |
( |
gnutls_x509_privkey_t |
k | ) |
|
Takes ownership of an existing gnutls_x509_privkey.
◆ decrypt()
| Blob dht::crypto::PrivateKey::decrypt |
( |
const uint8_t * |
cypher, |
|
|
size_t |
cypher_len |
|
) |
| const |
Try to decrypt the provided cypher text. In case of failure a CryptoException is thrown.
- Returns
- the decrypted data.
◆ generate()
| static PrivateKey dht::crypto::PrivateKey::generate |
( |
unsigned |
key_length = 4096 | ) |
|
|
static |
Generate a new RSA key pair
- Parameters
-
| key_length | : size of the modulus in bits Minimim value: 2048 Recommended values: 4096, 8192 |
◆ sign()
| Blob dht::crypto::PrivateKey::sign |
( |
const uint8_t * |
data, |
|
|
size_t |
data_len |
|
) |
| const |
Sign the provided binary object.
- Returns
- the signature data.
The documentation for this struct was generated from the following file:
- /home/abuild/rpmbuild/BUILD/opendht-2.4.4/include/opendht/crypto.h