Virgil Security Crypto library  1.8.2
VirgilByteArrayUtils.h
1 
37 #ifndef VIRGIL_CRYPTO_BYTE_ARRAY_UTILS_H
38 #define VIRGIL_CRYPTO_BYTE_ARRAY_UTILS_H
39 
40 #include <string>
41 
42 #include <virgil/crypto/VirgilByteArray.h>
43 
44 namespace virgil { namespace crypto {
45 
50 public:
61  static VirgilByteArray jsonToBytes(const std::string& json);
62 
66  static VirgilByteArray stringToBytes(const std::string& str);
67 
71  static std::string bytesToString(const VirgilByteArray& array);
72 
78  static VirgilByteArray hexToBytes(const std::string& hexStr);
79 
87  static std::string bytesToHex(const VirgilByteArray& array, bool formatted = false);
88 
94  static void zeroize(VirgilByteArray& array);
95 
96 private:
101 };
102 
103 }}
104 
105 #endif /* VIRGIL_CRYPTO_BYTE_ARRAY_UTILS_H */
static void zeroize(VirgilByteArray &array)
Make all bytes zero.
static std::string bytesToHex(const VirgilByteArray &array, bool formatted=false)
Translate given byte array to the HEX string.
static VirgilByteArray jsonToBytes(const std::string &json)
Represents given JSON object as byte array in canonical form.
static VirgilByteArray hexToBytes(const std::string &hexStr)
Translate given HEX string to the byte array.
Definition: VirgilAsn1Compatible.h:46
This class contains conversion utils for byte sequence.
Definition: VirgilByteArrayUtils.h:49
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.