Browse Source

update name: convertIfEcdsa => ecdsaAsn1SigToJoseSig

master
AJ ONeal 1 year 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) {
if ('EC' === opts.jwk.kty) {
// ECDSA JWT signatures differ from "normal" ECDSA signatures
// https://tools.ietf.org/html/rfc7518#section-3.4
binsig = convertIfEcdsa(binsig);
binsig = ecdsaAsn1SigToJoseSig(binsig);
}

var sig = binsig.toString('base64')
@@ -257,7 +257,7 @@ Keypairs.signJws = function (opts) {
};
}

function convertIfEcdsa(binsig) {
function ecdsaAsn1SigToJoseSig(binsig) {
// should have asn1 sequence header of 0x30
if (0x30 !== binsig[0]) { throw new Error("Impossible EC SHA head marker"); }
var index = 2; // first ecdsa "R" header byte


Loading…
Cancel
Save