DiceKeys Seeded Cryptography Library
|
3 #include "sodium-buffer.hpp"
4 #include "sealing-key.hpp"
64 const std::string& seedString,
79 const std::string& seedString,
91 const std::string& unsealingKeyAsJson
124 const unsigned char* ciphertext,
125 const size_t ciphertextLength,
126 const std::string& unsealingInstructions
142 const std::vector<unsigned char> &ciphertext,
143 const std::string& unsealingInstructions = {}
168 const std::string& seedString
185 const char indent_char =
' '
const SodiumBuffer unseal(const unsigned char *ciphertext, const size_t ciphertextLength, const std::string &unsealingInstructions) const
Unseal a message.
Definition: unsealing-key.cpp:60
A byte array containing a length and a pointer to memory (the data field), which ensures data is eras...
Definition: sodium-buffer.hpp:27
an UnsealingKey is used to unseal messages sealed with its corresponding SealingKey....
Definition: unsealing-key.hpp:16
const std::vector< unsigned char > sealingKeyBytes
The libsodium public key used for sealing.
Definition: unsealing-key.hpp:25
static const SodiumBuffer unseal(const PackagedSealedMessage &packagedSealedMessage, const std::string &seedString)
Unseal a message by re-deriving the UnsealingKey from its seed.
Definition: unsealing-key.hpp:166
const std::string recipe
A JSON Format for Recipes string used to specify how this key is derived.
Definition: unsealing-key.hpp:29
When a message is sealed, the ciphertext is packaged with the recipe in JSON Format for Recipes,...
Definition: packaged-sealed-message.hpp:14
static UnsealingKey fromSerializedBinaryForm(const SodiumBuffer &serializedBinaryForm)
Deserialize from a byte array stored as a list of: (unsealingKeyBytes, sealingKeyBytes,...
Definition: unsealing-key.cpp:150
static UnsealingKey fromJson(const std::string &unsealingKeyAsJson)
Construct (reconstitute) from serialized JSON format.
Definition: unsealing-key.cpp:113
A sealingKeyBytes is used to seal messages, in combination with a UnsealingKey which can unseal them....
Definition: sealing-key.hpp:36
UnsealingKey(const SodiumBuffer unsealingKeyBytes, const std::vector< unsigned char > sealingKeyBytes, const std::string recipe)
Construct a new UnsealingKey by passing its members.
Definition: unsealing-key.cpp:9
static UnsealingKey deriveFromSeed(const std::string &seedString, const std::string &recipe)
Construct a new UnsealingKey by deriving a public/private key pair from a seed string and a set of re...
Definition: unsealing-key.cpp:41
const std::vector< unsigned char > ciphertext
The sealed message as a raw array of bytes.
Definition: packaged-sealed-message.hpp:20
const std::string unsealingInstructions
Optional public instructions that the sealer requests the unsealer to follow as a condition of unseal...
Definition: packaged-sealed-message.hpp:30
const SodiumBuffer toSerializedBinaryForm() const
Serialize to byte array as a list of: (unsealingKeyBytes, sealingKeyBytes, recipe)
Definition: unsealing-key.cpp:139
const SodiumBuffer unsealingKeyBytes
The libSodium private key used for unsealing.
Definition: unsealing-key.hpp:21
const std::string recipe
The recipe used to generate the encryption/decryption keys.
Definition: packaged-sealed-message.hpp:25
const std::string toJson(int indent=-1, const char indent_char=' ') const
Serialize this object to a JSON-formatted string.
Definition: unsealing-key.cpp:127
const SealingKey getSealingKey() const
Get the SealingKey used to seal messages that can be unsealed with this UnsealingKey.
Definition: unsealing-key.cpp:99