forked from micalevisk/ssh-keygen-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
63 lines (58 loc) · 1.44 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/// <reference types="node" />
interface Config {
location?: string;
read?: boolean;
force?: boolean;
destroy?: boolean;
/**
* Path to the executable `ssh-keygen`.
* You will get an error if this path isn't valid.
* @default 'ssh-keygen'
*/
sshKeygenPath?: string;
}
interface SshKeygenOptions {
/**
* Provides the type of the key to be generated.
* @default 'rsa'
*/
type?: 'dsa' | 'ecdsa' | 'ecdsa-sk' | 'ed25519' | 'ed25519-sk' | 'rsa';
/**
* Provides a new comment to `shh-keygen` utility.
* @default ''
*/
comment?: string;
/**
* Provides the new passphrase.
* @default ''
*/
password?: string;
/**
* Specifies the number of bits in the key to create. The minimum size is
* 1024 bits.
* @default '2048'
*/
size?: string;
/**
* Specify a key format for key generation. Setting a format of "PEM" when
* generating a supported private key type will cause the key to be stored
* in the legacy PEM private key format.
* @default 'RFC4716'
*/
format?: 'RFC4716' | 'PKCS8' | 'PEM';
}
/**
* Generates SSH key-pairs.
*/
declare function keygen(
opts: Config & SshKeygenOptions,
callback: (
errOrMessage?: string | NodeJS.ErrnoException,
out?: { key: string; pubKey: string },
) => void,
): void;
/**
* Generates SSH key-pairs.
*/
declare function keygen(opts: Config & SshKeygenOptions): Promise<{ key: string; pubKey: string }>;
export default keygen;