Web Crypto: sign/verify
This page shows the use of the sign()
and verify()
functions of the Web Crypto API. It contains four separate examples, one for each signing algorithm supported:
- "RSASSA-PKCS1-v1_5"
- "RSA-PSS"
- "ECDSA"
- "HMAC"
Each example has four components:
- A text box containing a message to sign.
- A representation of the signature.
- A "Sign" button: this signs the text box contents, displays part of the signature, and stores the complete signature.
- A "Verify" button: this verifies the text box contents against the stored signature, and styles the displayed signature according to the result.
Try it:
- Press "Sign". The signature should appear.
- Press "Verify". The signature should be styled as valid.
- Edit the text box contents.
- Press "Verify". The signature should be styled as invalid.
RSASSA-PKCS1-v1_5
Signature:
RSA-PSS
Signature:
ECDSA
Signature:
HMAC
Signature: