| 186 | } |
| 187 | |
| 188 | bool Key::Sign(const uint8_t* md, const size_t len, std::vector<uint8_t>& signature) const |
| 189 | { |
| 190 | try |
| 191 | { |
| 192 | auto rsa = Crypt::CreateRSA(); |
| 193 | signature = rsa->SignData(*_key, md, len); |
| 194 | return true; |
| 195 | } |
| 196 | catch (const std::exception& e) |
| 197 | { |
| 198 | LOG_ERROR("Network::Key::Sign failed: %s", e.what()); |
| 199 | return false; |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | bool Key::Verify(const uint8_t* md, const size_t len, const std::vector<uint8_t>& signature) const |
| 204 | { |
no test coverage detected