This class contains conversion utils for byte sequence.
More...
#include <VirgilByteArrayUtils.h>
|
static VirgilByteArray | jsonToBytes (const std::string &json) |
| Represents given JSON object as byte array in canonical form. More...
|
|
static VirgilByteArray | stringToBytes (const std::string &str) |
| Represents given string as byte array.
|
|
static std::string | bytesToString (const VirgilByteArray &array) |
| Represent given byte array as string.
|
|
static VirgilByteArray | hexToBytes (const std::string &hexStr) |
| Translate given HEX string to the byte array. More...
|
|
static std::string | bytesToHex (const VirgilByteArray &array, bool formatted=false) |
| Translate given byte array to the HEX string. More...
|
|
static void | zeroize (VirgilByteArray &array) |
| Make all bytes zero. More...
|
|
This class contains conversion utils for byte sequence.
static std::string virgil::crypto::VirgilByteArrayUtils::bytesToHex |
( |
const VirgilByteArray & |
array, |
|
|
bool |
formatted = false |
|
) |
| |
|
static |
Translate given byte array to the HEX string.
- Parameters
-
array | - byte array. |
formatted | - if true, endline will be inserted every 16 bytes, and all bytes will be separated with whitespaces. |
- Returns
- HEX string.
static VirgilByteArray virgil::crypto::VirgilByteArrayUtils::hexToBytes |
( |
const std::string & |
hexStr | ) |
|
|
static |
Translate given HEX string to the byte array.
- Parameters
-
- Returns
- Byte array.
static VirgilByteArray virgil::crypto::VirgilByteArrayUtils::jsonToBytes |
( |
const std::string & |
json | ) |
|
|
static |
Represents given JSON object as byte array in canonical form.
- Note
- Conversion it to canonical form, ensure the same digest of JSON object, that can be differently formatted.
-
This method SHOULD be used before sign of JSON data object.
-
Underlying canonical representation is ASN.1, but it can be changed in future.
static void virgil::crypto::VirgilByteArrayUtils::zeroize |
( |
VirgilByteArray & |
array | ) |
|
|
static |
Make all bytes zero.
This method SHOULD be used to securely delete sensitive data.
The documentation for this class was generated from the following file: