MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / generateKey

Function generateKey

plugins/wasi_crypto/symmetric/key.cpp:24–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24WasiCryptoExpect<KeyVariant>
25generateKey(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
36SecretVec keyExportData(const KeyVariant &KeyVariant) noexcept {
37 return std::visit([](const auto &Key) noexcept { return Key.exportData(); },

Callers 1

symmetricKeyGenerateMethod · 0.85

Calls 1

generateFunction · 0.50

Tested by

no test coverage detected