UNPKG

jose

Version:

Universal 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK with no dependencies

13 lines (12 loc) 320 B
import * as crypto from 'crypto'; const webcrypto = crypto.webcrypto; export default webcrypto; export function isCryptoKey(key) { if (webcrypto !== undefined) { return key instanceof webcrypto.CryptoKey; } return false; } export function getKeyObject(key) { return crypto.KeyObject.from(key); }