DiceKeys Seeded Cryptography Library
|
4 #include "sodium-buffer.hpp"
5 #include "packaged-sealed-message.hpp"
89 const std::string& seedString,
104 const std::string& seedString,
122 const unsigned char* message,
123 const size_t messageLength,
124 const std::string& unsealingInstructions = {}
142 const std::string& unsealingInstructions = {}
159 const std::string& unsealingInstructions = {}
175 const std::string& message,
176 const std::string& unsealingInstructions = {}
192 const std::vector<unsigned char>& message,
193 const std::string& unsealingInstructions = {}
211 const unsigned char* message,
212 const size_t messageLength,
213 const std::string& unsealingInstructions = {}
232 const unsigned char* ciphertext,
233 const size_t ciphertextLength,
234 const std::string& unsealingInstructions = {}
250 const std::vector<unsigned char> &ciphertext,
251 const std::string& unsealingInstructions = {}
274 const std::string& seedString
289 const char indent_char =
' '
315 const std::string& symmetricKeyAsJson
324 const unsigned char* ciphertext,
325 const size_t ciphertextLength,
326 const std::string& unsealingInstructions = {}
const SodiumBuffer unseal(const unsigned char *ciphertext, const size_t ciphertextLength, const std::string &unsealingInstructions={}) const
Unseal a message.
Definition: symmetric-key.cpp:177
A byte array containing a length and a pointer to memory (the data field), which ensures data is eras...
Definition: sodium-buffer.hpp:27
const SodiumBuffer keyBytes
The binary representation of the symmetric key.
Definition: symmetric-key.hpp:46
const std::string recipe
A JSON Format for Recipes string used to specify how this key is derived.
Definition: symmetric-key.hpp:50
const std::string toJson(int indent=-1, const char indent_char=' ') const
Serialize this object to a JSON-formatted string.
Definition: symmetric-key.cpp:226
A SymmetricKey can be used to seal and unseal messages. This SymmetricKey class can be (re) derived f...
Definition: symmetric-key.hpp:39
When a message is sealed, the ciphertext is packaged with the recipe in JSON Format for Recipes,...
Definition: packaged-sealed-message.hpp:14
const SodiumBuffer toSerializedBinaryForm() const
Serialize to byte array as a list of: (keyBytes, recipe)
Definition: symmetric-key.cpp:239
const PackagedSealedMessage seal(const SodiumBuffer &message, const std::string &unsealingInstructions={}) const
Seal a plaintext message.
Definition: symmetric-key.cpp:97
const std::vector< unsigned char > sealToCiphertextOnly(const unsigned char *message, const size_t messageLength, const std::string &unsealingInstructions={}) const
Seal a plaintext message.
Definition: symmetric-key.cpp:59
const SodiumBuffer unsealMessageContents(const unsigned char *ciphertext, const size_t ciphertextLength, const std::string &unsealingInstructions={}) const
Internal implementation of unseal.
Definition: symmetric-key.cpp:140
static SymmetricKey fromSerializedBinaryForm(const SodiumBuffer &serializedBinaryForm)
Deserialize from a byte array stored as a list of: (keyBytes, recipe)
Definition: symmetric-key.cpp:247
static SymmetricKey deriveFromSeed(const std::string &seedString, const std::string &recipe)
Construct a new SymmetricKey by (re)deriving it from a seed string and a set of recipe in JSON Format...
Definition: symmetric-key.cpp:44
SymmetricKey(const SodiumBuffer &keyBytes, std::string recipe)
Construct a SymmetricKey from its members.
Definition: symmetric-key.cpp:26
static SymmetricKey fromJson(const std::string &symmetricKeyAsJson)
Internal implementation of JSON parser for the JSON contructor.
Definition: symmetric-key.cpp:212