(keyData, algorithm)
| 160 | |
| 161 | // Build minimal Jwk objects from raw key data and algorithm specifications |
| 162 | function jwkData(keyData, algorithm) { |
| 163 | var result = { |
| 164 | kty: "oct", |
| 165 | k: byteArrayToUnpaddedBase64(keyData) |
| 166 | }; |
| 167 | |
| 168 | if (algorithm.name.substring(0, 3) === "AES") { |
| 169 | result.alg = "A" + (8 * keyData.byteLength).toString() + algorithm.name.substring(4); |
| 170 | } else if (algorithm.name === "HMAC") { |
| 171 | result.alg = "HS" + algorithm.hash.substring(4); |
| 172 | } else if (algorithm.name.startsWith("KMAC")) { |
| 173 | result.alg = "K" + algorithm.name.substring(4); |
| 174 | } |
| 175 | return result; |
| 176 | } |
| 177 | |
| 178 | // Convert method parameters to a string to uniquely name each test |
| 179 | function parameterString(format, data, algorithm, extractable, usages) { |
no test coverage detected