Dlaczego OpenSSL zapewnia dwa narzędzia z tak dużym nakładaniem się
genpkey:
OpenSSL> genpkey -
Usage: genpkey [options]
where options may be
-out file output file
-outform X output format (DER or PEM)
-pass arg output file pass phrase source
-<cipher> use cipher <cipher> to encrypt the key
-engine e use engine e, possibly a hardware device.
-paramfile file parameters file
-algorithm alg the public key algorithm
-pkeyopt opt:value set the public key algorithm option <opt>
to value <value>
-genparam generate parameters, not key
-text print the in text
NB: options order may be important! See the manual page.
I genrsa:
OpenSSL> genrsa -
usage: genrsa [args] [numbits]
-des encrypt the generated key with DES in cbc mode
-des3 encrypt the generated key with DES in ede cbc mode (168 bit key)
-seed
encrypt PEM output with cbc seed
-aes128, -aes192, -aes256
encrypt PEM output with cbc aes
-camellia128, -camellia192, -camellia256
encrypt PEM output with cbc camellia
-out file output the key to 'file
-passout arg output file pass phrase source
-f4 use F4 (0x10001) for the E value
-3 use 3 for the E value
-engine e use engine e, possibly a hardware device.
-rand file:file:...
load the file (or the files in the directory) into
the random number generator
Dokumenty w Debianie są również bardzo dziwne,
genpkey Generation of Private Key or Parameters.
genrsa Generation of RSA Private Key. Superceded by genpkey.
Czy genpkeyzamiennik? Jeśli tak, to dlaczego nie ma -des3? Jak dodamy do niego hasło i określamy długość klucza?
genrsaigenpkeyfaktycznie są one różne. Struktura kluczy ASN.1 generowanych przy użyciugenrsato pkcs # 1, podczas gdy klucze generowane przy użyciugenpkeyto pkcs # 8. Jeśli to nie wystarczy, jeśli użyjeszgenpkey -outform der, wróci do pkcs # 1. Z KE, to jeszcze gorzej, jakośgenecbrakuje, a nie jestecparam -genkey, i jakośecparam -genkey,genpkey -outform pem,genpkey -outform dermają inną strukturę ASN.1.