The WebCrypto APIs are missing in Flow - see this GH issue: https://github.com/facebook/flow/issues/5019
There was a PR adding them but it was closed: https://github.com/facebook/flow/pull/7714
I copied the code from that PR and slightly modified it by removing TODO types
that were breaking type checks on valid code. Also made small adjustments for this
to fit types described on MDN: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto