WebCrypto API with secp256k1 support.
This is a light version of https://github.com/PeculiarVentures/webcrypto-liner/ that only contains secp256k1 support.
Thanks to PeculiarVentures
for their webcrypto-liner!
import { crypto, Crypto, CryptoKey, SubtleCrypto, polyfill } from '@masknet/secp256k1-webcrypto'
crypto // a polyfilled Crypto instance
crypto.subtle // a polyfilled SubtleCrypto instance
polyfill() // install the polyfill on the global object
- Node: Have native WebCrypto support.
- Web: Have native WebCrypro support.
You can create your own instance by
import { createCrypto } from '@masknet/secp256k1-webcrypto/core'
export const [crypto, { Crypto, CryptoKey, SubtleCrypto }, polyfill] = createCrypto(
globalThis.crypto,
globalThis.CryptoKey,
DOMException,
)
- spki format import/export