MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / signEc

Function signEc

wxapp/wps.js:184–191  ·  view source on GitHub ↗
(privateKey, text)

Source from the content-addressed store, hash-verified

182}
183
184function 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
193function deriveSecret(privateKey, serverJwkB64) {
194 const jwk = JSON.parse(Buffer.from(serverJwkB64, "base64url").toString("utf8"));

Callers 1

loginMethod · 0.85

Calls 1

signMethod · 0.45

Tested by

no test coverage detected