mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix(node): re-add incorrectly removed crypto.privateEncrypt/Decrypt (#39187)
This commit is contained in:
parent
9fc1486d6d
commit
74590ad311
2
types/node/crypto.d.ts
vendored
2
types/node/crypto.d.ts
vendored
@ -398,6 +398,8 @@ declare module "crypto" {
|
||||
}
|
||||
function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
||||
function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
||||
function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
||||
function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
||||
function getCiphers(): string[];
|
||||
function getCurves(): string[];
|
||||
function getHashes(): string[];
|
||||
|
||||
@ -648,9 +648,14 @@ import { promisify } from 'util';
|
||||
}
|
||||
|
||||
{
|
||||
const buf: Buffer = crypto.publicEncrypt({
|
||||
const key = {
|
||||
key: 'test',
|
||||
oaepHash: 'sha1',
|
||||
oaepLabel: Buffer.from('asd'),
|
||||
}, Buffer.from([]));
|
||||
};
|
||||
const buf: Buffer = crypto.publicEncrypt(key, Buffer.from([]));
|
||||
const dec: Buffer = crypto.publicDecrypt(key, buf);
|
||||
|
||||
const bufP: Buffer = crypto.privateEncrypt(key, Buffer.from([]));
|
||||
const decp: Buffer = crypto.privateDecrypt(key, bufP);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user