Extends KeyStore with specific functionality for polyseed-based cryptographic operations.
More...
#include <polyseed-key-store.hpp>
|
| PolyseedKeyStore () noexcept |
| Default constructor for an empty seed key store.
|
|
| PolyseedKeyStore (const std::array< uint8_t, 32 > &key) noexcept |
| Construct a PolyseedKeyStore from an existing key.
|
|
bool | isEncypted () const noexcept |
| check if polyseed_data secret in encrypted
|
|
| ~KeyStore () noexcept |
| Destroy KeyStore.
|
|
| KeyStore () noexcept |
| empty KeyStore
|
|
| KeyStore (const std::array< uint8_t, 32 > &key) noexcept |
| create KeyStore from byte array
|
|
| KeyStore (const uint8_t *key, size_t size) |
| create KeyStore from byte pointer and size
|
|
| KeyStore (crypto::secret_key key) noexcept |
| create a KeyStore by copying a crypto::secret_key into the KeyStore
|
|
void | set (const std::array< uint8_t, 32 > &key) noexcept |
| set key from byte array
|
|
void | set (const uint8_t *key, size_t size) |
| set key from byte pointer and size
|
|
void | set (crypto::secret_key key) noexcept |
| copy key from crypto::secret_key
|
|
void | wipe () noexcept |
| secure wipe of the keystore
|
|
Extends KeyStore with specific functionality for polyseed-based cryptographic operations.
◆ PolyseedKeyStore() [1/2]
ots::PolyseedKeyStore::PolyseedKeyStore |
( |
| ) |
|
|
explicitnoexcept |
Default constructor for an empty seed key store.
- Note
- Initializes an empty, secure key storage
◆ PolyseedKeyStore() [2/2]
ots::PolyseedKeyStore::PolyseedKeyStore |
( |
const std::array< uint8_t, 32 > & |
key | ) |
|
|
explicitnoexcept |
Construct a PolyseedKeyStore from an existing key.
- Parameters
-
key | Byte array representing the seed |
◆ commitPolyseedDataSession()
void ots::PolyseedKeyStore::commitPolyseedDataSession |
( |
| ) |
|
|
protected |
update PolyseedKeyStore data from the pointers secret and wipe secure
- Exceptions
-
◆ discardPolyseedDataSession()
void ots::PolyseedKeyStore::discardPolyseedDataSession |
( |
| ) |
|
|
protected |
wipe secure the pointers secret
- Exceptions
-
◆ getPolyseedDataReadOnlySession()
const polyseed_data * ots::PolyseedKeyStore::getPolyseedDataReadOnlySession |
( |
| ) |
|
|
protected |
Provide a polyseed_data struct const pointer to work with.
- Returns
- pointer of the polyseed_data struct enriched containing the secret from the PolyseedKeyStore
- Exceptions
-
- Note
- Need to unlockInsecure or better unlockInsecureOnce
-
Need to call discardPolyseedDataSession after finishing working with the const pointer to ensure the secret get's wiped out of insecure memory.
- Warning
- Do NOT copy the secret data from the pointer ever!
◆ getPolyseedDataSession()
polyseed_data * ots::PolyseedKeyStore::getPolyseedDataSession |
( |
| ) |
|
|
protected |
Provide a polyseed_data struct pointer to work On.
- Returns
- pointer of the polyseed_data struct enriched containing the secret from the PolyseedKeyStore
- Exceptions
-
- Warning
- You most like need only getPolyseedDataReadOnlySession, except for polyseed_crypt
- Note
- Need to unlockInsecure or unlockInsecureOnce for write
-
Need to call commitPolyseedDataSession or discardPolyseedDataSession after finishing working on the pointer to ensure the secret get's wiped out of insecure memory. Do NOT copy the secret data from the pointer.
- Warning
- Do NOT copy the secret data from the pointer ever!
◆ isEncypted()
bool ots::PolyseedKeyStore::isEncypted |
( |
| ) |
const |
|
noexcept |
check if polyseed_data secret in encrypted
- Returns
- true if encrypted
- Note
- using is_encrypted from features.h of polyseed to check without taking the secret out of the key store.
◆ operator const uint8_t *()
ots::PolyseedKeyStore::operator const uint8_t * |
( |
| ) |
|
|
protected |
Conversion to const byte pointer (read-only access)
- Exceptions
-
- Note
- You need first unlock the usage!
Usage example:
keyStore.unlockInsecureOnce();
some_const_byte_function(keyStore, 32);
◆ set()
void ots::PolyseedKeyStore::set |
( |
const polyseed_data * |
data | ) |
|
|
protected |
Internal method to set key data from polyseed_data->secret.
- Note
- friend class is used to ensure that only following classes can access key data in the KeyStore
- Parameters
-
◆ transfer()
void ots::PolyseedKeyStore::transfer |
( |
polyseed_data * |
data | ) |
|
|
protected |
Internal method to set key data from polyseed_data->secret, and wipes polyseed_data->secret.
- Parameters
-
◆ unsafe_mutable_bytes()
uint8_t * ots::PolyseedKeyStore::unsafe_mutable_bytes |
( |
| ) |
|
|
protected |
Get mutable byte access.
- Exceptions
-
- Warning
- Only for critical library-internal operations
- Note
- You need first unlock the usage!
Usage example:
keyStore.unlockInsecureOnce(true);
some_byte_manipulating_function(keyStore, 32);
◆ Polyseed
- Note
- friend class is used to ensure that only following classes can access key data in the PolyseedKeyStore
The documentation for this class was generated from the following files: