diff options
Diffstat (limited to 'packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts')
-rw-r--r-- | packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts b/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts index c39ebb44a..46ac7c8a6 100644 --- a/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts +++ b/packages/taler-wallet-core/src/crypto/workers/cryptoImplementation.ts @@ -80,6 +80,7 @@ enum SignaturePurpose { WALLET_COIN_MELT = 1202, TEST = 4242, MERCHANT_PAYMENT_OK = 1104, + MERCHANT_CONTRACT = 1101, WALLET_COIN_RECOUP = 1203, WALLET_COIN_LINK = 1204, EXCHANGE_CONFIRM_RECOUP = 1039, @@ -297,6 +298,18 @@ export class CryptoImplementation { return eddsaVerify(p, decodeCrock(sig), decodeCrock(masterPub)); } + isValidContractTermsSignature( + contractTermsHash: string, + sig: string, + merchantPub: string, + ): boolean { + const cthDec = decodeCrock(contractTermsHash); + const p = buildSigPS(SignaturePurpose.MERCHANT_CONTRACT) + .put(cthDec) + .build(); + return eddsaVerify(p, decodeCrock(sig), decodeCrock(merchantPub)); + } + /** * Create a new EdDSA key pair. */ |