mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
PR-URL: https://github.com/nodejs/node/pull/62453 Refs: https://github.com/nodejs/node/issues/55293 Refs: https://github.com/nodejs/node/pull/62321 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
24 lines
513 B
JavaScript
24 lines
513 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const { KeyObject } = require('crypto');
|
|
|
|
common.expectWarning({
|
|
DeprecationWarning: {
|
|
DEP0204: 'Passing a non-extractable CryptoKey to KeyObject.from() is deprecated.',
|
|
},
|
|
});
|
|
|
|
(async () => {
|
|
const key = await globalThis.crypto.subtle.generateKey(
|
|
{ name: 'AES-CBC', length: 128 },
|
|
false, // non-extractable
|
|
['encrypt'],
|
|
);
|
|
|
|
KeyObject.from(key);
|
|
})().then(common.mustCall());
|