(privateKey, text)
| 182 | } |
| 183 | |
| 184 | function signEc(privateKey, text) { |
| 185 | return crypto |
| 186 | .sign("sha256", Buffer.from(String(text)), { |
| 187 | key: privateKey.export({ type: "pkcs8", format: "pem" }), |
| 188 | dsaEncoding: "der", |
| 189 | }) |
| 190 | .toString("base64url"); |
| 191 | } |
| 192 | |
| 193 | function deriveSecret(privateKey, serverJwkB64) { |
| 194 | const jwk = JSON.parse(Buffer.from(serverJwkB64, "base64url").toString("utf8")); |