

No I didn't use the Web Crypto API - jorangreef
http://calvinmetcalf.com/post/103640348393/no-i-didnt-use-the-web-crypto-api

======
xyzzy123
I did some work with W3C Web Crypto and had a similar experience to the
author.

It's messy. You _can_ write compatible code, but you need good test suites and
some wrappers. A method to probe for supported algorithms would be super
useful. You're supposed to get a NotSupportedError DOMException if something
is not supported, but actual error results vary wildly.

In terms of getting consistent behaviour, Safari needs an exception shim
around its crypto methods because it throws immediately for many failures
while other browsers (which conform to the spec) signal failures only via
promise.

On the bright side, the IE11 implementation looks "more incompatible" than it
really is - in fact you can promisify it fairly simply, and it works more or
less like other browsers.

I was doing mostly signing, and found only RSASSA-PKCS1-v1_5 or HMAC were
actually usable - all the other algorithms are unsupported in at least one
browser (e.g. no RSA-PSS or ECDSA).

------
diafygi
Here's a live table of what parts of WebCryptoAPI your browser supports:

[https://diafygi.github.io/webcrypto-
examples/](https://diafygi.github.io/webcrypto-examples/)

~~~
xyzzy123
This is great! Doesn't work in Safari or IE though due to vendor prefixing. If
I get time, I'd like to push my shims at you :)

~~~
diafygi
Please do!

