make the ECDSA JSON signature parsing more robust

also rename the format to "Raw JSON"
as I will later introduce "JSON Web Signature"
This commit is contained in:
CPlusSharp 2024-04-14 12:42:44 +02:00
parent 7b54d9e873
commit 1fbc7e03f0
4 changed files with 70 additions and 19 deletions

View file

@ -48,7 +48,7 @@ class ECDSASign extends Operation {
value: [
"ASN.1 HEX",
"P1363 HEX",
"JSON"
"Raw JSON"
]
}
];
@ -86,7 +86,7 @@ class ECDSASign extends Operation {
case "P1363 HEX":
result = r.KJUR.crypto.ECDSA.asn1SigToConcatSig(signatureASN1Hex);
break;
case "JSON": {
case "Raw JSON": {
const signatureRS = r.KJUR.crypto.ECDSA.parseSigHexInHexRS(signatureASN1Hex);
result = JSON.stringify(signatureRS);
break;