summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2016-08-28 19:34:15 +0000
committerjmc <>2016-08-28 19:34:15 +0000
commite71cca3fe395f8a0ebdcb69774281c59594eaa5e (patch)
treefffbeb54dc7ee70a48f0558812a7c2dae9b1f3cc /src
parent1250d78eeed22bd3e5b5389e26f447d9d5f5969b (diff)
downloadopenbsd-e71cca3fe395f8a0ebdcb69774281c59594eaa5e.tar.gz
openbsd-e71cca3fe395f8a0ebdcb69774281c59594eaa5e.tar.bz2
openbsd-e71cca3fe395f8a0ebdcb69774281c59594eaa5e.zip
shorten the rsa text; of note, i've also reduced the description
for -inform/-outform/-text and removed the oft-repeated header/footer blurb;
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1322
1 files changed, 44 insertions, 278 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 7a416e74f2..f804dcef83 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.63 2016/08/27 20:43:05 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.64 2016/08/28 19:34:15 jmc Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -112,7 +112,7 @@
112.\" 112.\"
113.\" OPENSSL 113.\" OPENSSL
114.\" 114.\"
115.Dd $Mdocdate: August 27 2016 $ 115.Dd $Mdocdate: August 28 2016 $
116.Dt OPENSSL 1 116.Dt OPENSSL 1
117.Os 117.Os
118.Sh NAME 118.Sh NAME
@@ -971,11 +971,6 @@ Cipher suites using SHA1.
971The 971The
972.Nm crl 972.Nm crl
973command processes CRL files in DER or PEM format. 973command processes CRL files in DER or PEM format.
974The PEM CRL format uses the header and footer lines:
975.Bd -unfilled -offset indent
976-----BEGIN X509 CRL-----
977-----END X509 CRL-----
978.Ed
979.Pp 974.Pp
980The options are as follows: 975The options are as follows:
981.Bl -tag -width Ds 976.Bl -tag -width Ds
@@ -1015,7 +1010,7 @@ The output file to write to, or standard output if not specified.
1015.It Fl outform Cm der | pem 1010.It Fl outform Cm der | pem
1016The output format. 1011The output format.
1017.It Fl text 1012.It Fl text
1018Print the CRL in text form. 1013Print the CRL in plain text.
1019.El 1014.El
1020.Sh CRL2PKCS7 1015.Sh CRL2PKCS7
1021.nr nS 1 1016.nr nS 1
@@ -1048,7 +1043,7 @@ Read the CRL from
1048.Ar file , 1043.Ar file ,
1049or standard input if not specified. 1044or standard input if not specified.
1050.It Fl inform Cm der | pem 1045.It Fl inform Cm der | pem
1051Specify the CRL input format. 1046The input format.
1052.It Fl nocrl 1047.It Fl nocrl
1053Normally, a CRL is included in the output file. 1048Normally, a CRL is included in the output file.
1054With this option, no CRL is 1049With this option, no CRL is
@@ -1058,7 +1053,7 @@ Write the PKCS#7 structure to
1058.Ar file , 1053.Ar file ,
1059or standard output if not specified. 1054or standard output if not specified.
1060.It Fl outform Cm der | pem 1055.It Fl outform Cm der | pem
1061Specify the PKCS#7 structure output format. 1056The output format.
1062.El 1057.El
1063.Sh DGST 1058.Sh DGST
1064.nr nS 1 1059.nr nS 1
@@ -1227,17 +1222,6 @@ The input file to read from,
1227or standard input if not specified. 1222or standard input if not specified.
1228.It Fl inform Cm der | pem 1223.It Fl inform Cm der | pem
1229The input format. 1224The input format.
1230.Cm der
1231uses an ASN1 DER-encoded form compatible with the PKCS#3 DHparameter
1232structure.
1233.Cm pem
1234is the default:
1235it consists of the DER format base64-encoded with
1236additional header and footer lines:
1237.Bd -unfilled -offset indent
1238-----BEGIN DH PARAMETERS-----
1239-----END DH PARAMETERS-----
1240.Ed
1241.It Fl noout 1225.It Fl noout
1242Do not output the encoded version of the parameters. 1226Do not output the encoded version of the parameters.
1243.It Fl out Ar file 1227.It Fl out Ar file
@@ -1246,7 +1230,7 @@ or standard output if not specified.
1246.It Fl outform Cm der | pem 1230.It Fl outform Cm der | pem
1247The output format. 1231The output format.
1248.It Fl text 1232.It Fl text
1249Print the DH parameters in human readable form. 1233Print the DH parameters in plain text.
1250.It Ar numbits 1234.It Ar numbits
1251Generate a parameter set of size 1235Generate a parameter set of size
1252.Ar numbits . 1236.Ar numbits .
@@ -1288,18 +1272,6 @@ newer applications should use the more secure PKCS#8 format using the
1288.Nm pkcs8 1272.Nm pkcs8
1289command. 1273command.
1290.Pp 1274.Pp
1291The PEM private key format uses the header and footer lines:
1292.Bd -unfilled -offset indent
1293-----BEGIN DSA PRIVATE KEY-----
1294-----END DSA PRIVATE KEY-----
1295.Ed
1296.Pp
1297The PEM public key format uses the header and footer lines:
1298.Bd -unfilled -offset indent
1299-----BEGIN PUBLIC KEY-----
1300-----END PUBLIC KEY-----
1301.Ed
1302.Pp
1303The options are as follows: 1275The options are as follows:
1304.Bl -tag -width Ds 1276.Bl -tag -width Ds
1305.It Xo 1277.It Xo
@@ -1323,21 +1295,6 @@ or standard input if not specified.
1323If the key is encrypted, a pass phrase will be prompted for. 1295If the key is encrypted, a pass phrase will be prompted for.
1324.It Fl inform Cm der | pem 1296.It Fl inform Cm der | pem
1325The input format. 1297The input format.
1326.Cm der
1327with a private key uses an ASN1 DER-encoded form of an ASN.1
1328SEQUENCE consisting of the values of version
1329.Pq currently zero ,
1330P, Q, G,
1331and the public and private key components, respectively, as ASN.1 INTEGERs.
1332When used with a public key it uses a
1333.Em SubjectPublicKeyInfo
1334structure: it is an error if the key is not DSA.
1335.Pp
1336.Cm pem
1337is the default format:
1338it consists of the DER format base64-encoded with additional header and footer
1339lines.
1340In the case of a private key, PKCS#8 format is also accepted.
1341.It Fl modulus 1298.It Fl modulus
1342Print the value of the public key component of the key. 1299Print the value of the public key component of the key.
1343.It Fl noout 1300.It Fl noout
@@ -1359,7 +1316,7 @@ Read in a public key, not a private key.
1359Output a public key, not a private key. 1316Output a public key, not a private key.
1360Automatically set if the input is a public key. 1317Automatically set if the input is a public key.
1361.It Fl text 1318.It Fl text
1362Print the public/private key components and parameters. 1319Print the public/private key in plain text.
1363.El 1320.El
1364.Sh DSAPARAM 1321.Sh DSAPARAM
1365.nr nS 1 1322.nr nS 1
@@ -1379,12 +1336,6 @@ The
1379.Nm dsaparam 1336.Nm dsaparam
1380command is used to manipulate or generate DSA parameter files. 1337command is used to manipulate or generate DSA parameter files.
1381.Pp 1338.Pp
1382PEM format DSA parameters use the header and footer lines:
1383.Bd -unfilled -offset indent
1384-----BEGIN DSA PARAMETERS-----
1385-----END DSA PARAMETERS-----
1386.Ed
1387.Pp
1388The options are as follows: 1339The options are as follows:
1389.Bl -tag -width Ds 1340.Bl -tag -width Ds
1390.It Fl C 1341.It Fl C
@@ -1403,14 +1354,6 @@ If the
1403parameter is included, then this option is ignored. 1354parameter is included, then this option is ignored.
1404.It Fl inform Cm der | pem 1355.It Fl inform Cm der | pem
1405The input format. 1356The input format.
1406.Cm der
1407uses an ASN1 DER-encoded form compatible with RFC 2459
1408.Pq PKIX
1409DSS-Parms that is a SEQUENCE consisting of p, q and g, respectively.
1410.Cm pem
1411is the default format:
1412it consists of the DER format base64-encoded with additional header
1413and footer lines.
1414.It Fl noout 1357.It Fl noout
1415Do not output the encoded version of the parameters. 1358Do not output the encoded version of the parameters.
1416.It Fl out Ar file 1359.It Fl out Ar file
@@ -1419,7 +1362,7 @@ or standard output if not specified.
1419.It Fl outform Cm der | pem 1362.It Fl outform Cm der | pem
1420The output format. 1363The output format.
1421.It Fl text 1364.It Fl text
1422Print the DSA parameters in human readable form. 1365Print the DSA parameters in plain text.
1423.It Ar numbits 1366.It Ar numbits
1424Generate a parameter set of size 1367Generate a parameter set of size
1425.Ar numbits . 1368.Ar numbits .
@@ -1459,18 +1402,6 @@ EC private key into the PKCS#8 private key format use the
1459.Nm pkcs8 1402.Nm pkcs8
1460command. 1403command.
1461.Pp 1404.Pp
1462The PEM private key format uses the header and footer lines:
1463.Bd -literal -offset indent
1464-----BEGIN EC PRIVATE KEY-----
1465-----END EC PRIVATE KEY-----
1466.Ed
1467.Pp
1468The PEM public key format uses the header and footer lines:
1469.Bd -literal -offset indent
1470-----BEGIN PUBLIC KEY-----
1471-----END PUBLIC KEY-----
1472.Ed
1473.Pp
1474The options are as follows: 1405The options are as follows:
1475.Bl -tag -width Ds 1406.Bl -tag -width Ds
1476.It Fl conv_form Ar arg 1407.It Fl conv_form Ar arg
@@ -1510,17 +1441,6 @@ or standard input if not specified.
1510If the key is encrypted a pass phrase will be prompted for. 1441If the key is encrypted a pass phrase will be prompted for.
1511.It Fl inform Cm der | pem 1442.It Fl inform Cm der | pem
1512The input format. 1443The input format.
1513.Cm der
1514with a private key uses
1515an ASN.1 DER-encoded SEC1 private key.
1516When used with a public key it
1517uses the SubjectPublicKeyInfo structure as specified in RFC 3280.
1518.Cm pem
1519is the default format:
1520it consists of the DER format base64-encoded
1521with additional header and footer lines.
1522In the case of a private key
1523PKCS#8 format is also accepted.
1524.It Fl noout 1444.It Fl noout
1525Do not output the encoded version of the key. 1445Do not output the encoded version of the key.
1526.It Fl out Ar file 1446.It Fl out Ar file
@@ -1554,7 +1474,7 @@ Read in a public key, not a private key.
1554Output a public key, not a private key. 1474Output a public key, not a private key.
1555Automatically set if the input is a public key. 1475Automatically set if the input is a public key.
1556.It Fl text 1476.It Fl text
1557Print the public/private key components and parameters. 1477Print the public/private key in plain text.
1558.El 1478.El
1559.Sh ECPARAM 1479.Sh ECPARAM
1560.nr nS 1 1480.nr nS 1
@@ -1583,12 +1503,6 @@ is not able to generate new groups so
1583.Nm ecparam 1503.Nm ecparam
1584can only create EC parameters from known (named) curves. 1504can only create EC parameters from known (named) curves.
1585.Pp 1505.Pp
1586PEM format EC parameters use the header and footer lines:
1587.Bd -literal -offset indent
1588-----BEGIN EC PARAMETERS-----
1589-----END EC PARAMETERS-----
1590.Ed
1591.Pp
1592The options are as follows: 1506The options are as follows:
1593.Bl -tag -width Ds 1507.Bl -tag -width Ds
1594.It Fl C 1508.It Fl C
@@ -1623,13 +1537,6 @@ The input file to read from,
1623or standard input if not specified. 1537or standard input if not specified.
1624.It Fl inform Cm der | pem 1538.It Fl inform Cm der | pem
1625The input format. 1539The input format.
1626.Cm der
1627uses an ASN.1 DER-encoded
1628form compatible with RFC 3279 EcpkParameters.
1629.Cm pem
1630is the default format:
1631it consists of the DER format base64-encoded with additional
1632header and footer lines.
1633.It Fl list_curves 1540.It Fl list_curves
1634Print a list of all 1541Print a list of all
1635currently implemented EC parameter names and exit. 1542currently implemented EC parameter names and exit.
@@ -1660,7 +1567,7 @@ Note: the
1660alternative, as specified in RFC 3279, 1567alternative, as specified in RFC 3279,
1661is currently not implemented. 1568is currently not implemented.
1662.It Fl text 1569.It Fl text
1663Print the EC parameters in human readable form. 1570Print the EC parameters in plain text.
1664.El 1571.El
1665.Sh ENC 1572.Sh ENC
1666.nr nS 1 1573.nr nS 1
@@ -1986,8 +1893,7 @@ The value to use for the generator
1986The EC curve to use. 1893The EC curve to use.
1987.El 1894.El
1988.It Fl text 1895.It Fl text
1989Print an unencrypted text representation of private and public keys and 1896Print the private/public key in plain text.
1990parameters along with the DER or PEM structure.
1991.El 1897.El
1992.Sh GENRSA 1898.Sh GENRSA
1993.nr nS 1 1899.nr nS 1
@@ -2495,18 +2401,6 @@ command processes PKCS#7 files in DER or PEM format.
2495The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315. 2401The PKCS#7 routines only understand PKCS#7 v 1.5 as specified in RFC 2315.
2496They cannot currently parse, for example, the new CMS as described in RFC 2630. 2402They cannot currently parse, for example, the new CMS as described in RFC 2630.
2497.Pp 2403.Pp
2498The PEM PKCS#7 format uses the header and footer lines:
2499.Bd -unfilled -offset indent
2500-----BEGIN PKCS7-----
2501-----END PKCS7-----
2502.Ed
2503.Pp
2504For compatibility with some CAs it will also accept:
2505.Bd -unfilled -offset indent
2506-----BEGIN CERTIFICATE-----
2507-----END CERTIFICATE-----
2508.Ed
2509.Pp
2510The options are as follows: 2404The options are as follows:
2511.Bl -tag -width Ds 2405.Bl -tag -width Ds
2512.It Fl in Ar file 2406.It Fl in Ar file
@@ -2514,11 +2408,6 @@ The input file to read from,
2514or standard input if not specified. 2408or standard input if not specified.
2515.It Fl inform Cm der | pem 2409.It Fl inform Cm der | pem
2516The input format. 2410The input format.
2517.Cm der
2518format is a DER-encoded PKCS#7 v1.5 structure.
2519.Cm pem
2520(the default)
2521is a base64-encoded version of the DER form with header and footer lines.
2522.It Fl noout 2411.It Fl noout
2523Don't output the encoded version of the PKCS#7 structure 2412Don't output the encoded version of the PKCS#7 structure
2524(or certificates if 2413(or certificates if
@@ -2592,10 +2481,6 @@ or standard input if not specified.
2592If the key is encrypted, a pass phrase will be prompted for. 2481If the key is encrypted, a pass phrase will be prompted for.
2593.It Fl inform Cm der | pem 2482.It Fl inform Cm der | pem
2594The input format. 2483The input format.
2595If a PKCS#8 format key is expected on input,
2596then either a
2597DER- or PEM-encoded version of a PKCS#8 key will be expected.
2598Otherwise the DER or PEM format of the traditional format private key is used.
2599.It Fl nocrypt 2484.It Fl nocrypt
2600Generate an unencrypted PrivateKeyInfo structure. 2485Generate an unencrypted PrivateKeyInfo structure.
2601This option does not encrypt private keys at all 2486This option does not encrypt private keys at all
@@ -2908,8 +2793,7 @@ Read in a public key, not a private key.
2908Output a public key, not a private key. 2793Output a public key, not a private key.
2909Automatically set if the input is a public key. 2794Automatically set if the input is a public key.
2910.It Fl text 2795.It Fl text
2911Print out the various public or private key components in plain text 2796Print the public/private key in plain text.
2912in addition to the encoded version.
2913.It Fl text_pub 2797.It Fl text_pub
2914Print out only public key components 2798Print out only public key components
2915even if a private key is being processed. 2799even if a private key is being processed.
@@ -2937,7 +2821,7 @@ Do not output the encoded version of the parameters.
2937The output file to write to, 2821The output file to write to,
2938or standard output if not specified. 2822or standard output if not specified.
2939.It Fl text 2823.It Fl text
2940Print the parameters in plain text, in addition to the encoded version. 2824Print the parameters in plain text.
2941.El 2825.El
2942.Sh PKEYUTL 2826.Sh PKEYUTL
2943.nr nS 1 2827.nr nS 1
@@ -3237,12 +3121,6 @@ and
3237are not specified. 3121are not specified.
3238.It Fl inform Cm der | pem 3122.It Fl inform Cm der | pem
3239The input format. 3123The input format.
3240.Cm der
3241uses an ASN1 DER-encoded form compatible with the PKCS#10.
3242.Cm pem
3243is the default format:
3244it consists of the DER format base64-encoded with additional header and
3245footer lines.
3246.It Fl key Ar keyfile 3124.It Fl key Ar keyfile
3247The file to read the private key from. 3125The file to read the private key from.
3248It also accepts PKCS#8 format private keys for PEM format files. 3126It also accepts PKCS#8 format private keys for PEM format files.
@@ -3365,7 +3243,7 @@ Print the request subject (or certificate subject if
3365.Fl x509 3243.Fl x509
3366is specified). 3244is specified).
3367.It Fl text 3245.It Fl text
3368Print the certificate request in text form. 3246Print the certificate request in plain text.
3369.It Fl utf8 3247.It Fl utf8
3370Interpret field values as UTF8 strings, not ASCII. 3248Interpret field values as UTF8 strings, not ASCII.
3371.It Fl verbose 3249.It Fl verbose
@@ -3592,18 +3470,6 @@ options in the configuration file.
3592Any additional fields will be treated as though they were a 3470Any additional fields will be treated as though they were a
3593.Cm DirectoryString . 3471.Cm DirectoryString .
3594.Pp 3472.Pp
3595The header and footer lines in the PEM format are normally:
3596.Bd -unfilled -offset indent
3597-----BEGIN CERTIFICATE REQUEST-----
3598-----END CERTIFICATE REQUEST-----
3599.Ed
3600.Pp
3601Some software instead needs:
3602.Bd -unfilled -offset indent
3603-----BEGIN NEW CERTIFICATE REQUEST-----
3604-----END NEW CERTIFICATE REQUEST-----
3605.Ed
3606.Pp
3607The following messages are frequently asked about: 3473The following messages are frequently asked about:
3608.Bd -unfilled -offset indent 3474.Bd -unfilled -offset indent
3609Using configuration from /some/path/openssl.cnf 3475Using configuration from /some/path/openssl.cnf
@@ -3633,24 +3499,17 @@ then the SET OF is missing and the encoding is technically invalid
3633See the description 3499See the description
3634.Fl asn1-kludge 3500.Fl asn1-kludge
3635for more information. 3501for more information.
3636.\"
3637.\" RSA
3638.\"
3639.Sh RSA 3502.Sh RSA
3640.nr nS 1 3503.nr nS 1
3641.Nm "openssl rsa" 3504.Nm "openssl rsa"
3642.Bk -words 3505.Op Fl aes128 | aes192 | aes256 | des | des3
3643.Oo
3644.Fl aes128 | aes192 | aes256 |
3645.Fl des | des3
3646.Oc
3647.Op Fl check 3506.Op Fl check
3648.Op Fl in Ar file 3507.Op Fl in Ar file
3649.Op Fl inform Ar DER | NET | PEM 3508.Op Fl inform Cm der | net | pem
3650.Op Fl modulus 3509.Op Fl modulus
3651.Op Fl noout 3510.Op Fl noout
3652.Op Fl out Ar file 3511.Op Fl out Ar file
3653.Op Fl outform Ar DER | NET | PEM 3512.Op Fl outform Cm der | net | pem
3654.Op Fl passin Ar arg 3513.Op Fl passin Ar arg
3655.Op Fl passout Ar arg 3514.Op Fl passout Ar arg
3656.Op Fl pubin 3515.Op Fl pubin
@@ -3658,15 +3517,13 @@ for more information.
3658.Op Fl sgckey 3517.Op Fl sgckey
3659.Op Fl text 3518.Op Fl text
3660.nr nS 0 3519.nr nS 0
3661.Ek
3662.Pp 3520.Pp
3663The 3521The
3664.Nm rsa 3522.Nm rsa
3665command processes RSA keys. 3523command processes RSA keys.
3666They can be converted between various forms and their components printed out. 3524They can be converted between various forms and their components printed out.
3667.Pp 3525.Nm rsa
3668.Sy Note : 3526uses the traditional
3669this command uses the traditional
3670.Nm SSLeay 3527.Nm SSLeay
3671compatible format for private key encryption: 3528compatible format for private key encryption:
3672newer applications should use the more secure PKCS#8 format using the 3529newer applications should use the more secure PKCS#8 format using the
@@ -3675,11 +3532,8 @@ utility.
3675.Pp 3532.Pp
3676The options are as follows: 3533The options are as follows:
3677.Bl -tag -width Ds 3534.Bl -tag -width Ds
3678.It Xo 3535.It Fl aes128 | aes192 | aes256 | des | des3
3679.Fl aes128 | aes192 | aes256 | 3536Encrypt the private key with the AES, DES,
3680.Fl des | des3
3681.Xc
3682These options encrypt the private key with the AES, DES,
3683or the triple DES ciphers, respectively, before outputting it. 3537or the triple DES ciphers, respectively, before outputting it.
3684A pass phrase is prompted for. 3538A pass phrase is prompted for.
3685If none of these options are specified, the key is written in plain text. 3539If none of these options are specified, the key is written in plain text.
@@ -3690,128 +3544,39 @@ to remove the pass phrase from a key, or by setting the encryption options
3690it can be used to add or change the pass phrase. 3544it can be used to add or change the pass phrase.
3691These options can only be used with PEM format output files. 3545These options can only be used with PEM format output files.
3692.It Fl check 3546.It Fl check
3693This option checks the consistency of an RSA private key. 3547Check the consistency of an RSA private key.
3694.It Fl in Ar file 3548.It Fl in Ar file
3695This specifies the input 3549The input file to read from,
3696.Ar file 3550or standard input if not specified.
3697to read a key from, or standard input if this
3698option is not specified.
3699If the key is encrypted, a pass phrase will be prompted for. 3551If the key is encrypted, a pass phrase will be prompted for.
3700.It Fl inform Ar DER | NET | PEM 3552.It Fl inform Cm der | net | pem
3701This specifies the input format. 3553The input format.
3702The
3703.Ar DER
3704argument
3705uses an ASN1 DER-encoded form compatible with the PKCS#1
3706RSAPrivateKey or SubjectPublicKeyInfo format.
3707The
3708.Ar PEM
3709form is the default format: it consists of the DER format base64-encoded with
3710additional header and footer lines.
3711On input PKCS#8 format private keys are also accepted.
3712The
3713.Ar NET
3714form is a format described in the
3715.Sx RSA NOTES
3716section.
3717.It Fl noout 3554.It Fl noout
3718This option prevents output of the encoded version of the key. 3555Do not output the encoded version of the key.
3719.It Fl modulus 3556.It Fl modulus
3720This option prints out the value of the modulus of the key. 3557Print the value of the modulus of the key.
3721.It Fl out Ar file 3558.It Fl out Ar file
3722This specifies the output 3559The output file to write to,
3723.Ar file 3560or standard output if not specified.
3724to write a key to, or standard output if this option is not specified. 3561.It Fl outform Cm der | net | pem
3725If any encryption options are set, a pass phrase will be prompted for. 3562The output format.
3726The output filename should
3727.Em not
3728be the same as the input filename.
3729.It Fl outform Ar DER | NET | PEM
3730This specifies the output format; the options have the same meaning as the
3731.Fl inform
3732option.
3733.It Fl passin Ar arg 3563.It Fl passin Ar arg
3734The key password source. 3564The key password source.
3735.It Fl passout Ar arg 3565.It Fl passout Ar arg
3736The output file password source. 3566The output file password source.
3737.It Fl pubin 3567.It Fl pubin
3738By default, a private key is read from the input file; with this 3568Read in a public key,
3739option a public key is read instead. 3569not a private key.
3740.It Fl pubout 3570.It Fl pubout
3741By default, a private key is output; 3571Output a public key,
3742with this option a public key will be output instead. 3572not a private key.
3743This option is automatically set if the input is a public key. 3573Automatically set if the input is a public key.
3744.It Fl sgckey 3574.It Fl sgckey
3745Use the modified 3575Use the modified NET algorithm used with some versions of Microsoft IIS
3746.Em NET 3576and SGC keys.
3747algorithm used with some versions of Microsoft IIS and SGC keys.
3748.It Fl text 3577.It Fl text
3749Prints out the various public or private key components in 3578Print the public/private key components in plain text.
3750plain text, in addition to the encoded version.
3751.El 3579.El
3752.Sh RSA NOTES
3753The PEM private key format uses the header and footer lines:
3754.Bd -unfilled -offset indent
3755-----BEGIN RSA PRIVATE KEY-----
3756-----END RSA PRIVATE KEY-----
3757.Ed
3758.Pp
3759The PEM public key format uses the header and footer lines:
3760.Bd -unfilled -offset indent
3761-----BEGIN PUBLIC KEY-----
3762-----END PUBLIC KEY-----
3763.Ed
3764.Pp
3765The
3766.Em NET
3767form is a format compatible with older Netscape servers
3768and Microsoft IIS .key files; this uses unsalted RC4 for its encryption.
3769It is not very secure and so should only be used when necessary.
3770.Pp
3771Some newer version of IIS have additional data in the exported .key files.
3772To use these with the
3773.Nm rsa
3774utility, view the file with a binary editor
3775and look for the string
3776.Qq private-key ,
3777then trace back to the byte sequence 0x30, 0x82
3778.Pq this is an ASN1 SEQUENCE .
3779Copy all the data from this point onwards to another file and use that as
3780the input to the
3781.Nm rsa
3782utility with the
3783.Fl inform Ar NET
3784option.
3785If there is an error after entering the password, try the
3786.Fl sgckey
3787option.
3788.Sh RSA EXAMPLES
3789To remove the pass phrase on an RSA private key:
3790.Pp
3791.Dl $ openssl rsa -in key.pem -out keyout.pem
3792.Pp
3793To encrypt a private key using triple DES:
3794.Pp
3795.Dl $ openssl rsa -in key.pem -des3 -out keyout.pem
3796.Pp
3797To convert a private key from PEM to DER format:
3798.Pp
3799.Dl $ openssl rsa -in key.pem -outform DER -out keyout.der
3800.Pp
3801To print out the components of a private key to standard output:
3802.Pp
3803.Dl $ openssl rsa -in key.pem -text -noout
3804.Pp
3805To just output the public part of a private key:
3806.Pp
3807.Dl $ openssl rsa -in key.pem -pubout -out pubkey.pem
3808.Sh RSA BUGS
3809The command line password arguments don't currently work with
3810.Em NET
3811format.
3812.Pp
3813There should be an option that automatically handles .key files,
3814without having to manually edit them.
3815.\" 3580.\"
3816.\" RSAUTL 3581.\" RSAUTL
3817.\" 3582.\"
@@ -7649,19 +7414,20 @@ This can be used to send the data via a pipe, for example.
7649Read the password from standard input. 7414Read the password from standard input.
7650.El 7415.El
7651.Pp 7416.Pp
7652File formats, 7417Input/output formats,
7653typically specified using 7418typically specified using
7654.Fl inform 7419.Fl inform
7655and 7420and
7656.Fl outform , 7421.Fl outform ,
7657indicate the type of file being read from 7422indicate the format being read from or written to.
7658or the file format to write.
7659The argument is case insensitive. 7423The argument is case insensitive.
7660.Pp 7424.Pp
7661.Bl -tag -width Ds -offset indent -compact 7425.Bl -tag -width Ds -offset indent -compact
7662.It Cm der 7426.It Cm der
7663Distinguished Encoding Rules (DER) 7427Distinguished Encoding Rules (DER)
7664is a binary format. 7428is a binary format.
7429.It Cm net
7430Insecure legacy format.
7665.It Cm pem 7431.It Cm pem
7666Privacy Enhanced Mail (PEM) 7432Privacy Enhanced Mail (PEM)
7667is base64-encoded. 7433is base64-encoded.