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
514 B
JavaScript
24 lines
514 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const crypto = require('crypto');
|
|
|
|
common.expectWarning({
|
|
DeprecationWarning: {
|
|
DEP0203: 'Passing a CryptoKey to node:crypto functions is deprecated.',
|
|
},
|
|
});
|
|
|
|
(async () => {
|
|
const key = await globalThis.crypto.subtle.generateKey(
|
|
{ name: 'AES-CBC', length: 128 },
|
|
true,
|
|
['encrypt'],
|
|
);
|
|
|
|
crypto.createCipheriv('aes-128-cbc', key, Buffer.alloc(16));
|
|
})().then(common.mustCall());
|