| 22 | } |
| 23 | |
| 24 | WasiCryptoExpect<KeyVariant> |
| 25 | generateKey(Algorithm Alg, OptionalRef<const Options> OptOptions) noexcept { |
| 26 | return std::visit( |
| 27 | [OptOptions](auto Factory) noexcept { |
| 28 | return decltype(Factory)::Key::generate(OptOptions) |
| 29 | .map([](auto &&Key) noexcept { |
| 30 | return KeyVariant{std::forward<decltype(Key)>(Key)}; |
| 31 | }); |
| 32 | }, |
| 33 | Alg); |
| 34 | } |
| 35 | |
| 36 | SecretVec keyExportData(const KeyVariant &KeyVariant) noexcept { |
| 37 | return std::visit([](const auto &Key) noexcept { return Key.exportData(); }, |
no test coverage detected