update name: convertIfEcdsa => ecdsaAsn1SigToJoseSig
This commit is contained in:
parent
48bee9204d
commit
b22f957124
|
@ -240,7 +240,7 @@ Keypairs.signJws = function (opts) {
|
||||||
if ('EC' === opts.jwk.kty) {
|
if ('EC' === opts.jwk.kty) {
|
||||||
// ECDSA JWT signatures differ from "normal" ECDSA signatures
|
// ECDSA JWT signatures differ from "normal" ECDSA signatures
|
||||||
// https://tools.ietf.org/html/rfc7518#section-3.4
|
// https://tools.ietf.org/html/rfc7518#section-3.4
|
||||||
binsig = convertIfEcdsa(binsig);
|
binsig = ecdsaAsn1SigToJoseSig(binsig);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sig = binsig.toString('base64')
|
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
|
// should have asn1 sequence header of 0x30
|
||||||
if (0x30 !== binsig[0]) { throw new Error("Impossible EC SHA head marker"); }
|
if (0x30 !== binsig[0]) { throw new Error("Impossible EC SHA head marker"); }
|
||||||
var index = 2; // first ecdsa "R" header byte
|
var index = 2; // first ecdsa "R" header byte
|
||||||
|
|
Loading…
Reference in New Issue