IPSEC-ECDSASIGKEY(8)
๐ IPSEC-ECDSASIGKEY ๐
okay bestie, welcome to ipsec-ecdsasigkey, a lil member of the Executable programs squad ๐ she makes you an ECDSA signature key and honestly? she ate. let's get into it ๐
โจ NAME โจ
ipsec-ecdsasigkey โ generate ECDSA signature key ๐
โจ SYNOPSIS โจ
ipsec ecdsasigkey [--verbose] [--nssdir directory] [--nsspw password]
[--seeddev device] [--seedbits bits]
[--hostname hostname] [curvename]
โจ DESCRIPTION โจ
so ecdsasigkey generates an ECDSA public/private key pair, suitable for digital signatures, on a named curve that you specify with curvename. and like, she's a lil picky (iconic behaviour honestly) โ currently she only accepts secp256r1, secp384r1, and secp521r1. that's it, that's the list ๐ซถ
The public exponent is forced to the value 3, which has important speed advantages for signature checking. but bestie, beware โ the resulting keys have known weaknesses as encryption keys and should not be used for that purpose. it's giving "signatures only, ma'am" ๐
The --verbose option makes ecdsasigkey give a running commentary on standard error. By default, it works in silence until it is ready to generate output. not me being quiet the whole time and then dropping the whole key like โจ
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)). 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. a whole stream of zeroes?? in the wild?? girl no ๐ญ
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. math is math ๐งฎ
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. periodt, no negotiating ๐
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 --nsspw 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 argument is the password. so it's giving "either a file path OR the actual password, choose your fighter" ๐ฅ
โจ OPTIONS โจ
--verboseโ makesecdsasigkeygive a running commentary on standard error. without it, she works in silence until she's ready to generate output ๐คซ--nssdirdirectory โ the directory to use for the nss database, aka where the NSS certificate, key and security modules databases reside. default:/var/lib/ipsec/nss๐--nsspwpassword โ the nss cryptographic module authentication password, for when the NSS module has been configured to require it. hardware tokens need it, and so does 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 argument is the password ๐--seeddevdevice โ source for random bits used to seed the crypto library's RNG. default:/dev/random(seerandom(4)). 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 โ but never access those directly with this option, because hardware failures could lead to extremely non-random values (streams of zeroes have been observed in the wild) ๐ฒ๐--seedbitsbits โ how many seed bits are pulled from the random device to seed the NSS PRNG. default480bit, which comes from FIPS requirements. seed bits get rounded up to a multiple of 8 ๐ข--hostnamehostname โ bestie this one is literally in the synopsis but the description does not say more about it, and i am NOT gonna make up lore. that's all we got ๐- curvename โ the named curve for your ECDSA public/private key pair, suitable for digital signatures. only
secp256r1,secp384r1, andsecp521r1are accepted, no cap ๐
heads up: using a different random device, or reducing --seedbits below the default, is prevented when the system is running in FIPS mode ๐
โจ EXAMPLES โจ
ipsec ecdsasigkey --verbose secp521r1
that one generates a secp521r1-based key and stores this key in the NSS database. The public key can then be extracted and edited into the ipsec.conf (see ipsec-showhostkey(8)). go off โจ๐
โจ 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 ๐๐
โจ HISTORY โจ
Originally written for the Linux FreeS/WAN project <https://www.freeswan.org> by Henry Spencer. Updated for the Libreswan Project by Paul Wouters. we love a glow-up ๐ฆ
- The
--roundand--nooptoptions were obsoleted as these were only used with the old non-library crypto code โ rip to them, they're with the ancients now ๐ - The
--randomdevice is only used for seeding the crypto library, not for direct random to generate keys ๐ฎ
โจ BUGS โจ
ecdsasigkey'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. she's โจmysteriousโจ and honestly not in a cute way this time ๐ญ
Specifically, embedded systems and most virtual machines are low on entropy. In such a situation, consider generating the ECDSA 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. like. identical identical. don't play ๐ โโ๏ธ
โจ AUTHOR โจ
Andrew Cagney, Daiki Ueno, Daniel Kahn Gillmor, D. Hugh Redelmeier, Harald Jenny, Jose Quaresma, Michael Richardson, Paul Wouters, Simon Deziel, Tuomo Soini ๐๐๐ the whole squad fr fr
and that's the whole page bestie!! this one's from Libreswan 5.4.1, dated 10/23/2026, and it lives in section 8 of the manual (that's IPSEC-ECDSASIGKEY(8) if you're keeping score ๐
). go generate something iconic ๐ธโจ
๐ฆ where this page comes from
- fedora 43: libreswan 5.4.1-1.fc43 ยท GPL-2.0-or-later AND MPL-2.0
- fedora 44: libreswan 5.4.1-1.fc44 ยท GPL-2.0-or-later AND MPL-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms