mirror of
https://github.com/danbulant/jose
synced 2026-05-25 13:01:49 +00:00
6 lines
260 B
JavaScript
6 lines
260 B
JavaScript
const { randomBytes, createSecretKey } = require('crypto')
|
|
|
|
const KEYLENGTHS = require('../help/key_lengths')
|
|
const importKey = require('../jwk/import')
|
|
|
|
module.exports = alg => importKey(createSecretKey(randomBytes(KEYLENGTHS[alg] / 8)), { use: 'enc', alg })
|