1 .TH "PKI \-\-GEN" 1 "2013-07-31" "@PACKAGE_VERSION@" "strongSwan"
5 pki \-\-gen \- Generate a new RSA or ECDSA private key
15 .OP \-\-outform encoding
20 .BI \-\-options\~ file
33 is used to generate a new RSA or ECDSA private key.
39 Print usage information with a summary of the available options.
41 .BI "\-v, \-\-debug " level
42 Set debug level, default: 1.
44 .BI "\-+, \-\-options " file
45 Read command line options from \fIfile\fR.
47 .BI "\-t, \-\-type " type
48 Type of key to generate. Either \fIrsa\fR or \fIecdsa\fR, defaults to \fIrsa\fR.
50 .BI "\-s, \-\-size " bits
51 Key length in bits. Defaults to 2048 for \fIrsa\fR and 384 for \fIecdsa\fR.
52 For \fIecdsa\fR only three values are currently supported: 256, 384 and 521.
54 .BI "\-p, \-\-safe\-primes"
55 Generate RSA safe primes.
57 .BI "\-f, \-\-outform " encoding
58 Encoding of the generated private key. Either \fIder\fR (ASN.1 DER) or \fIpem\fR
59 (Base64 PEM), defaults
62 .SS "RSA Threshold Cryptography"
64 .BI "\-n, \-\-shares " <n>
65 Number of private RSA key shares.
67 .BI "\-l, \-\-threshold " <l>
68 Minimum number of participating RSA key shares.
70 .SH "PROBLEMS ON HOSTS WITH LOW ENTROPY"
74 plugin is used to generate RSA private keys the key material is read from
78 plugin). Therefore, the command may block if the system's entropy pool is empty.
79 To avoid this, either use a hardware random number generator to feed
81 or use OpenSSL (via the
83 plugin or the command line) which is not as strict in regards to the quality of
84 the key material (it reads from
86 if necessary). It is also possible to configure the devices used by the
89 .BR strongswan.conf (5).
91 .B libstrongswan.plugins.random.random
94 forces the plugin to treat bytes read from
96 as high grade random data, thus avoiding the blocking. Of
97 course, this doesn't change the fact that the key material generated this way is
103 .B pki \-\-gen \-\-size 3072 > rsa_key.der
104 Generates a 3072-bit RSA private key.
107 .B pki \-\-gen \-\-type ecdsa \-\-size 256 > ecdsa_key.der
108 Generates a 256-bit ECDSA private key.