STRONGSWAN_PKI---GEN(1)
π pki --gen β like, the manual page but make it make sense π
okay bestie, so this is the page for PKI --GEN(1) from strongSwan, and it's literally all about generating a shiny new RSA or ECDSA private key. yes, the --GEN is right there in the name, no cap. this sub-command lives under pki(1) and it's the one you call when you need fresh key material and you want it done right. π
β¨ NAME β¨
pki --gen β generate a new RSA or ECDSA private key ποΈβ¨
πΈ SYNOPSIS πΈ
pki --gen [--type type] [--size bits] [--safe-primes] [--shares n]
[--threshold l] [--outform encoding] [--debug level]
pki --gen --options file
pki --gen -h | --help
like, that's the whole vibe check in three lines. π«Ά
π¦ DESCRIPTION π¦
so this sub-command of pki(1) is the one that generates you a brand new RSA or ECDSA private key. that's it. that's the job. she's a specialist, she's iconic, she does one thing and she eats. π
π OPTIONS π
-h,--helpβ prints the usage info plus a little summary of every option you can use. your friendly lil cheat sheet. π-v,--debug levelβ sets the debug level. default is1. crank it up if you're nosy (affectionate).-+,--options fileβ reads the command line options from file instead of making you type them all out. yes,-+is really the short flag, she's quirky like that. β¨-t,--type typeβ the type of key to generate. eitherrsa,ecdsa,ed25519, ored448. defaults torsa. pick your fighter. π₯-s,--size bitsβ key length in bits. defaults to2048forrsaand384forecdsa. and heads up: forecdsaonly three values are currently supported β256,384and521. no, you can't freestyle a fourth one, bestie. π-p,--safe-primesβ generate RSA safe primes. extra careful, extra spicy. π‘οΈ-f,--outform encodingβ encoding of the generated private key. eitherder(ASN.1 DER) orpem(Base64 PEM). defaults toder. β
π RSA Threshold Cryptography π
-n,--shares <n>β number of private RSA key shares. splitting the key like it's a group project, except this time everyone actually participates. π-l,--threshold <l>β minimum number of participating RSA key shares. like, how many of the squad need to show up before the key works. π
π PROBLEMS ON HOSTS WITH LOW ENTROPY π
okay so this part is important, don't skip it.
if the gmp plugin is used to generate RSA private keys, the key material is read from /dev/random (via the random plugin). which means the command may block if the system's entropy pool is empty. literally just sitting there. waiting. not a vibe. π
to avoid this, you've got options:
- use a hardware random number generator to feed
/dev/random, or - use OpenSSL (via the openssl plugin or the command line), which is not as strict in regards to the quality of the key material β it reads from
/dev/urandomif necessary.
it's also possible to configure the devices used by the random plugin in strongswan.conf(5).
setting libstrongswan.plugins.random.random to /dev/urandom forces the plugin to treat bytes read from /dev/urandom as high grade random data, thus avoiding the blocking.
but of course, this doesn't change the fact that the key material generated this way is of lower quality. like, you fixed the waiting, not the vibe. be honest with yourself about that. π«
π EXAMPLES π
pki --gen --size 3072 > rsa_key.der
generates a 3072-bit RSA private key. big girl energy. πͺ
pki --gen --type ecdsa --size 256 > ecdsa_key.der
generates a 256-bit ECDSA private key. small, fast, slays. π¦
π SEE ALSO π
and that's the whole page, bestie β you ate that. π
strongSwan version 6.0.7, dated 2016-12-13. periodt. π
π¦ where this page comes from
- fedora 43: strongswan 6.0.7-2.fc43 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms