Browse Source

update name: convertIfEcdsa => ecdsaAsn1SigToJoseSig

master
AJ ONeal 6 months ago
parent
commit
b22f957124
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      keypairs.js

+ 2
- 2
keypairs.js View File

@@ -240,7 +240,7 @@ Keypairs.signJws = function (opts) {
240 240
       if ('EC' === opts.jwk.kty) {
241 241
         // ECDSA JWT signatures differ from "normal" ECDSA signatures
242 242
         // https://tools.ietf.org/html/rfc7518#section-3.4
243
-        binsig = convertIfEcdsa(binsig);
243
+        binsig = ecdsaAsn1SigToJoseSig(binsig);
244 244
       }
245 245
 
246 246
       var sig = binsig.toString('base64')
@@ -257,7 +257,7 @@ Keypairs.signJws = function (opts) {
257 257
       };
258 258
     }
259 259
 
260
-    function convertIfEcdsa(binsig) {
260
+    function ecdsaAsn1SigToJoseSig(binsig) {
261 261
       // should have asn1 sequence header of 0x30
262 262
       if (0x30 !== binsig[0]) { throw new Error("Impossible EC SHA head marker"); }
263 263
       var index = 2; // first ecdsa "R" header byte

Loading…
Cancel
Save