Closed paullinator closed 3 months ago
Sorry but I can't see the link above.
I see your code before and it seems the issue of RSAPSS salt length difference between node crypto and jsrsasign.
To verify RSAPSS signature generated by Node crypto, you need to specify salt length in jsrsasign as follows:
const s3 = new jsrsasign.KJUR.crypto.Signature({alg: "SHA512withRSAandMGF1", psssaltlen: -2});
RSAPSS signature default: Node crypto: saltLength=crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN=-2 (This will be 446 for SHA512) jsrsasign: 20(SHA1), 32(SHA256), 48(SHA384), 64(SHA512)
I seems no further comments. This will be closed.
give the same
privateKey
I'm using the following code to generate and verify signatures using nodejscrypto
andjsrsasign
. jsrsasign can't seem to create a valid signature that node crypto with verify as correct. Here's my code. Any help would be appreciatedhttps://github.com/EdgeApp/edge-react-gui/blob/paul/paybisSig/src/testcrypto.ts