IPSEC_RSASIGKEY(8)
πΈ IPSEC_RSASIGKEY π
okay bestie, welcome to ipsec_rsasigkey from the libreswan fam β yes, it's a section 8 manual page, and yes, it's about to become your whole personality β¨
β¨ NAME β¨
ipsec_rsasigkey β generate an RSA signature key π
β¨ SYNOPSIS β¨
ipsec rsasigkey [--verbose] [--seeddev device] [--seed numbits]
[--nssdir nssdir] [--password nsspassword] [--hostname hostname]
[nbits]
β¨ DESCRIPTION β¨
So rsasigkey literally births an RSA public/private key pair fr fr β one that's suitable for digital signatures β of exactly nbits bits. And when we say exactly, we mean it: that's two primes each of exactly nbits/2 bits, plus the related numbers. Then it drops the whole thing on standard output as ASCII (mostly hex) data. Also super important: nbits must be a multiple of 16. no exceptions, bestie π
The public exponent is forced to the value 3, which has huge speed advantages for signature checking β like, iconic performance behavior π. But beware: the resulting keys have known weaknesses as encryption keys and should not be used for that purpose. Read that again. Not for encryption. π
The --verbose option makes rsasigkey give a running commentary on standard error. By default it works in silence until it's ready to generate output β like a mysterious main character who says nothing until the dramatic reveal π¦
The --seeddev option specifies a source for random bits used to seed the crypto library's RNG. The default is /dev/random (see random(4)). Fun lore drop: FreeS/WAN and Openswan without NSS support used this option to specify the random source used to directly create keys. Libreswan only uses it to seed the NSS crypto libraries RNG. Under Linux with hardware random support, special devices might show up as /dev/*rng* devices. However, these should never be accessed directly using this option, as hardware failures could lead to extremely non-random values (streams of zeroes have been observed in the wild π). like, actual zeroes. a whole vibe collapse.
The --seedbits option specifies how many seed bits are pulled from the random device to seed the NSS PRNG. The default of 480bit comes from FIPS requirements. Seed bits are rounded up to a multiple of 8 π
β οΈ The use of a different random device or a reduction of seedbits from the default value is prevented when the system is running in FIPS mode. no negotiating with FIPS, babe.
The --nssdir option specifies the directory to use for the nss database. This is the directory where the NSS certificate, key and security modules databases reside πΈ The default value is /var/lib/ipsec/nss.
The --password option specifies the nss cryptographic module authentication password if the NSS module has been configured to require it. A password is required by hardware tokens and also by the internal software token module when configured to run in FIPS mode π₯ If the argument is /etc/ipsec.d/nsspassword, the password comes from that file; otherwise the argument is the password. sneaky but slay.
The US patent on the RSA algorithm expired 20 Sept 2000. periodt. π
β¨ EXAMPLES β¨
ipsec rsasigkey --verbose 4096β generates a4096-bit signature key and stores this key in the NSS database π The public key can then be extracted and edited into theipsec.conf(seeipsec_showhostkey(8)). iykyk.
β¨ FILES β¨
/dev/random/dev/urandom
β¨ SEE ALSO β¨
random(4), rngd(8), ipsec_showhostkey(8), Applied Cryptography, 2nd. ed., by Bruce Schneier, Wiley 1996, RFCs 2537, 2313, GNU MP, the GNU multiple precision arithmetic library, edition 2.0.2, by Torbj Granlund π (that's a reading list, bestie, not a suggestion)
β¨ HISTORY β¨
Originally written for the Linux FreeS/WAN project <https://www.freeswan.org> by Henry Spencer. Updated for the Libreswan Project by Paul Wouters π«Ά
- The
--roundand--nooptoptions were obsoleted as these were only used with the old non-library crypto code. they're gone, we don't talk about them π - The
--randomdevice is only used for seeding the crypto library, not for direct random to generate keys.
β¨ BUGS β¨
There is an internal limit on nbits, currently 20000. yes, there's a ceiling. π
rsasigkey's run time is difficult to predict, since /dev/random output can be arbitrarily delayed if the system's entropy pool is low on randomness, and the time taken by the search for primes is also somewhat unpredictable. Specifically, embedded systems and most virtual machines are low on entropy π In such a situation, consider generating the RSA key on another machine, and copying ipsec.secrets and the /var/lib/ipsec/nss directory tree to the embedded platform. Note that NSS embeds the full path in the DB files, so the path on proxy machine must be identical to the path on the destination machine. identical. character for character. no cap β
β¨ AUTHOR β¨
Paul Wouters
- placeholder to suppress warning
mood: cryptographic, slightly feral, fully seeded π§ β that was libreswan, dated 10/19/2026, signing off π
π¦ where this page comes from
- centos-stream 9: libreswan 4.15-11.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms