jose/lib/help/key_object.js
2019-03-28 20:51:00 +01:00

8 lines
273 B
JavaScript

const { createSecretKey, KeyObject } = require('crypto')
if (KeyObject) {
module.exports = KeyObject
} else {
const SecretKeyObject = Object.getPrototypeOf(createSecretKey(Buffer.allocUnsafe(1)))
module.exports = Object.getPrototypeOf(SecretKeyObject).constructor
}