mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
8dfc211b7e
commit
2deba96b71
4
types/node/crypto.d.ts
vendored
4
types/node/crypto.d.ts
vendored
@@ -423,8 +423,8 @@ declare module "crypto" {
|
||||
|
||||
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
||||
format: T;
|
||||
cipher: string;
|
||||
passphrase: string;
|
||||
cipher?: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
|
||||
interface KeyPairKeyObjectResult {
|
||||
|
||||
@@ -337,6 +337,21 @@ import { promisify } from 'util';
|
||||
},
|
||||
});
|
||||
|
||||
const rsaResNoPassphrase: {
|
||||
publicKey: Buffer;
|
||||
privateKey: string;
|
||||
} = crypto.generateKeyPairSync('rsa', {
|
||||
modulusLength: 123,
|
||||
publicKeyEncoding: {
|
||||
format: 'der',
|
||||
type: 'pkcs1',
|
||||
},
|
||||
privateKeyEncoding: {
|
||||
format: 'pem',
|
||||
type: 'pkcs8',
|
||||
},
|
||||
});
|
||||
|
||||
const dsaRes: {
|
||||
publicKey: string;
|
||||
privateKey: Buffer;
|
||||
@@ -355,6 +370,22 @@ import { promisify } from 'util';
|
||||
},
|
||||
});
|
||||
|
||||
const dsaResNoPassphrase: {
|
||||
publicKey: string;
|
||||
privateKey: Buffer;
|
||||
} = crypto.generateKeyPairSync('dsa', {
|
||||
modulusLength: 123,
|
||||
divisorLength: 123,
|
||||
publicKeyEncoding: {
|
||||
format: 'pem',
|
||||
type: 'spki',
|
||||
},
|
||||
privateKeyEncoding: {
|
||||
format: 'der',
|
||||
type: 'pkcs8',
|
||||
},
|
||||
});
|
||||
|
||||
const ecRes: {
|
||||
publicKey: string;
|
||||
privateKey: string;
|
||||
@@ -371,6 +402,21 @@ import { promisify } from 'util';
|
||||
type: 'pkcs8',
|
||||
},
|
||||
});
|
||||
|
||||
const ecResNoPassphrase: {
|
||||
publicKey: string;
|
||||
privateKey: string;
|
||||
} = crypto.generateKeyPairSync('ec', {
|
||||
namedCurve: 'curve',
|
||||
publicKeyEncoding: {
|
||||
format: 'pem',
|
||||
type: 'pkcs1',
|
||||
},
|
||||
privateKeyEncoding: {
|
||||
format: 'pem',
|
||||
type: 'pkcs8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user