| 201 | } |
| 202 | |
| 203 | bool Key::Verify(const uint8_t* md, const size_t len, const std::vector<uint8_t>& signature) const |
| 204 | { |
| 205 | try |
| 206 | { |
| 207 | auto rsa = Crypt::CreateRSA(); |
| 208 | return rsa->VerifyData(*_key, md, len, signature.data(), signature.size()); |
| 209 | } |
| 210 | catch (const std::exception& e) |
| 211 | { |
| 212 | LOG_ERROR("Network::Key::Verify failed: %s", e.what()); |
| 213 | return false; |
| 214 | } |
| 215 | } |
| 216 | } // namespace OpenRCT2::Network |
| 217 | |
| 218 | #endif // DISABLE_NETWORK |
no test coverage detected