update name: convertIfEcdsa => ecdsaAsn1SigToJoseSig

This commit is contained in:
AJ ONeal 2019-05-06 03:07:30 -06:00
parent 48bee9204d
commit b22f957124
1 changed files with 2 additions and 2 deletions

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