| 272 | } |
| 273 | |
| 274 | std::string CryptoModule::pickleAccount(const std::string &secretKey) { |
| 275 | try { |
| 276 | // Convert secretKey to 32-byte array |
| 277 | std::array<uint8_t, 32> key; |
| 278 | std::copy_n( |
| 279 | secretKey.begin(), std::min(secretKey.size(), size_t(32)), key.begin()); |
| 280 | |
| 281 | return std::string(this->vodozemacAccount->pickle(key)); |
| 282 | } catch (const std::exception &e) { |
| 283 | throw std::runtime_error("error pickleAccount => " + std::string(e.what())); |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | Persist CryptoModule::storeAsB64(const std::string &secretKey) { |
| 288 | Persist persist; |
no test coverage detected