| 250 | } |
| 251 | |
| 252 | String unhexKey(const String & hex) |
| 253 | { |
| 254 | try |
| 255 | { |
| 256 | return boost::algorithm::unhex(hex); |
| 257 | } |
| 258 | catch (const std::exception &) |
| 259 | { |
| 260 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Cannot read key_hex, check for valid characters [0-9a-fA-F] and length"); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | /// Firstly, write a byte, which shows if the nonce will be put in text (if it was defined in config) |
| 265 | /// Secondly, write nonce in text (this step depends from first step) |