mirror of
https://github.com/danbulant/jose
synced 2026-05-25 04:51:47 +00:00
7 lines
300 B
JavaScript
7 lines
300 B
JavaScript
const { randomBytes } = require('crypto')
|
|
|
|
const { createSecretKey } = require('../help/key_object')
|
|
const { KEYLENGTHS } = require('../help/consts')
|
|
const importKey = require('../jwk/import')
|
|
|
|
module.exports = alg => importKey(createSecretKey(randomBytes(KEYLENGTHS[alg] / 8)), { use: 'enc', alg })
|