mirror of
https://github.com/danbulant/jose
synced 2026-05-24 20:41:46 +00:00
BREAKING CHANGE: key.algorithms(op) un+wrapKey was split into correct wrapKey/unwrapKey/deriveKey returns BREAKING CHANGE: keystore.all and keystore.get `operation` option was removed, `key_ops: string[]` supersedes it
6 lines
259 B
JavaScript
6 lines
259 B
JavaScript
const { randomBytes, createSecretKey } = require('crypto')
|
|
|
|
const { KEYLENGTHS } = require('../help/consts')
|
|
const importKey = require('../jwk/import')
|
|
|
|
module.exports = alg => importKey(createSecretKey(randomBytes(KEYLENGTHS[alg] / 8)), { use: 'enc', alg })
|