MCPcopy Index your code
hub / github.com/nodejs/node / jwkData

Function jwkData

test/fixtures/wpt/WebCryptoAPI/import_export/okp_importKey.js:106–118  ·  view source on GitHub ↗
(keyData, algorithm)

Source from the content-addressed store, hash-verified

104
105// Build minimal Jwk objects from raw key data and algorithm specifications
106function jwkData(keyData, algorithm) {
107 var result = {
108 kty: "oct",
109 k: byteArrayToUnpaddedBase64(keyData)
110 };
111
112 if (algorithm.name.substring(0, 3) === "AES") {
113 result.alg = "A" + (8 * keyData.byteLength).toString() + algorithm.name.substring(4);
114 } else if (algorithm.name === "HMAC") {
115 result.alg = "HS" + algorithm.hash.substring(4);
116 }
117 return result;
118}
119
120// Convert method parameters to a string to uniquely name each test
121function parameterString(format, data, algorithm, extractable, usages) {

Callers

nothing calls this directly

Calls 2

toStringMethod · 0.45

Tested by

no test coverage detected