I am developing an little web application that should allow the user to »bring your own key« in order to encrypt, decrypt, sign and verify data within the browser. Looking at this table (algorithm overview) shows that not all operations for a certain type of Key are actually supported by the Web Cryptography API.
For Instance:
Encryption and decryption only with with RSA-OAEP
. Signing and verification, on the other hand, is only supported for RSASSA-PKCS1-v1_5
and RSA-PSS
. Assuming the user comes along with a key pair in pkcs8
and spki
format respectively for the private and public key. I would need to create different »JS CryptoKey Instances« in order to support all actions (en- / decryption AND signing / Verification).
All in All I do not really understand:
- why can't
ECDSA
orEd25519
keys used for en- / decryption? - why can
ECDH
only be used for key- and bit- derivation while non of the others can?
I hope my memory doesn't trick me, but keys based on elliptic curves support en- / decryption, don't they? Isn't that the same thing for signing and verification?
So, what's the reason behind these sort of »exclusive« possible usages?