(privateKey, serverJwkB64)
| 191 | } |
| 192 | |
| 193 | function deriveSecret(privateKey, serverJwkB64) { |
| 194 | const jwk = JSON.parse(Buffer.from(serverJwkB64, "base64url").toString("utf8")); |
| 195 | const publicKey = crypto.createPublicKey({ key: jwk, format: "jwk" }); |
| 196 | return crypto.diffieHellman({ privateKey, publicKey }).toString("base64url"); |
| 197 | } |
| 198 | |
| 199 | async function wxServerCode(openid, appid) { |
| 200 | const { data } = await axios.post( |