Closed cedrick-ah closed 1 week ago
The use of ieee-p1363
encoding of the signature is intentional and as per the spec as I understand it.
There are normative examples from the spec that form part of the test suite to ensure compliance.
Allowing other signature encodings would be contrary to the spec and potentially open security issues if we attempted to verify the signature as DER encoded. It is, of course, possible to provide the library with a custom verifier to enable what you're asking.
I got a
Malformed signature
error from Nodejs crypto module when I used theecdsa-p256-sha256
algorithm.Here is the full error:
I read this from Nodejs about the dsaEncoding then I tried changing the
dsaEncoding
in thecreateVerifier
function fromieee-p1363
toder
which solved the error. Is it possible to implement a functionality to pass an optionalencoding
parameter for algorithms that have multiple encodings?I am in a case where the signer is not the verifier.