MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / fromRSAKey

Method fromRSAKey

src/Common/JSONWebKey.cpp:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28JSONWebKey JSONWebKey::fromRSAKey(const KeyPair & key)
29{
30 auto e = key.encryptionExponent();
31 auto n = key.modulus();
32
33 auto e_enc = base64Encode({e.begin(), e.end()}, /*url_encoding*/ true, /*no_padding*/ true);
34 auto n_enc = base64Encode({n.begin(), n.end()}, /*url_encoding*/ true, /*no_padding*/ true);
35
36 return JSONWebKey{
37 .e = e_enc,
38 .n = n_enc,
39 .kty = "RSA",
40 };
41}
42
43}
44#endif

Callers

nothing calls this directly

Calls 5

base64EncodeFunction · 0.85
encryptionExponentMethod · 0.80
modulusMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected