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

Function createBioFromSpan

plugins/wasi_crypto/utils/evp_wrapper.cpp:18–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace {
17
18BioPtr createBioFromSpan(Span<const uint8_t> Encoded) {
19 BioPtr Bio{BIO_new(BIO_s_mem())};
20 if (!Bio) {
21 return nullptr;
22 }
23
24 size_t Size;
25 if (!BIO_write_ex(Bio.get(), Encoded.data(), Encoded.size(), &Size) ||
26 Size != Encoded.size()) {
27 return nullptr;
28 }
29 return Bio;
30}
31
32template <typename T, typename WriteFunc>
33WasiCryptoExpect<T> writeKeyToBio(EVP_PKEY *Key, WriteFunc &&Func) {

Callers 4

pemReadPUBKEYFunction · 0.85
pemReadPrivateKeyFunction · 0.85
d2iPUBKEYFunction · 0.85
d2iPrivateKeyFunction · 0.85

Calls 3

getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected