summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2010-10-09 18:22:46 +0000
committerjmc <>2010-10-09 18:22:46 +0000
commitcf1172f0df0a72a9576ab5827e8002cb01a905f9 (patch)
treeadd864819508f8a0d3f0ff596117ecc66a0669fc /src
parentc11440122a12473ff58c3ec76b88db05c3c6733a (diff)
downloadopenbsd-cf1172f0df0a72a9576ab5827e8002cb01a905f9.tar.gz
openbsd-cf1172f0df0a72a9576ab5827e8002cb01a905f9.tar.bz2
openbsd-cf1172f0df0a72a9576ab5827e8002cb01a905f9.zip
document "openssl pkey";
Diffstat (limited to 'src')
-rw-r--r--src/usr.sbin/openssl/openssl.1128
1 files changed, 127 insertions, 1 deletions
diff --git a/src/usr.sbin/openssl/openssl.1 b/src/usr.sbin/openssl/openssl.1
index 386699c6ff..73cbf23686 100644
--- a/src/usr.sbin/openssl/openssl.1
+++ b/src/usr.sbin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.73 2010/10/09 10:03:44 jmc Exp $ 1.\" $OpenBSD: openssl.1,v 1.74 2010/10/09 18:22:46 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.\"
@@ -316,6 +316,8 @@ PKCS#7 data management.
316PKCS#8 data management. 316PKCS#8 data management.
317.It Cm pkcs12 317.It Cm pkcs12
318PKCS#12 data management. 318PKCS#12 data management.
319.It Cm pkey
320Public and private key management.
319.It Cm rand 321.It Cm rand
320Generate pseudo-random bytes. 322Generate pseudo-random bytes.
321.It Cm req 323.It Cm req
@@ -5018,6 +5020,130 @@ $ openssl -in keycerts.pem -export -name "My PKCS#12 file" \e
5018 -out fixed.p12 5020 -out fixed.p12
5019.Ed 5021.Ed
5020.\" 5022.\"
5023.\" PKEY
5024.\"
5025.Sh PKEY
5026.Cm openssl pkey
5027.Bk -words
5028.Op Ar cipher
5029.Op Fl noout
5030.Op Fl pubin
5031.Op Fl pubout
5032.Op Fl text
5033.Op Fl text_pub
5034.Op Fl engine Ar id
5035.Op Fl in Ar filename
5036.Op Fl inform Ar DER | PEM
5037.Op Fl out Ar filename
5038.Op Fl outform Ar DER | PEM
5039.Op Fl passin Ar arg
5040.Op Fl passout Ar arg
5041.Ek
5042.Pp
5043The
5044.Nm pkey
5045command processes public or private keys.
5046They can be converted between various forms
5047and their components printed out.
5048.Pp
5049The options are as follows:
5050.Bl -tag -width Ds
5051.It Ar cipher
5052These options encrypt the private key with the supplied cipher.
5053Any algorithm name accepted by
5054.Fn EVP_get_cipherbyname
5055is acceptable, such as
5056.Cm des3 .
5057.It Fl engine Ar id
5058Specifying an engine (by its unique
5059.Ar id
5060string) will cause
5061.Nm pkey
5062to attempt to obtain a functional reference to the specified engine,
5063thus initialising it if needed.
5064The engine will then be set as the default
5065for all available algorithms.
5066.It Fl in Ar filename
5067This specifies the input filename to read a key from,
5068or standard input if this option is not specified.
5069If the key is encrypted a pass phrase will be prompted for.
5070.It Fl inform Ar DER | PEM
5071This specifies the input format, DER or PEM.
5072.It Fl noout
5073Do not output the encoded version of the key.
5074.It Fl out Ar filename
5075This specifies the output filename to write a key to,
5076or standard output if this option is not specified.
5077If any encryption options are set then a pass phrase
5078will be prompted for.
5079The output filename should
5080.Em not
5081be the same as the input filename.
5082.It Fl outform Ar DER | PEM
5083This specifies the output format;
5084the options have the same meaning as the
5085.Fl inform
5086option.
5087.It Fl passin Ar arg
5088The input file password source.
5089For more information about the format of
5090.Ar arg
5091see the
5092.Sx PASS PHRASE ARGUMENTS
5093section above.
5094.It Fl passout Ar arg
5095The output file password source.
5096For more information about the format of
5097.Ar arg
5098see the
5099.Sx PASS PHRASE ARGUMENTS
5100section above.
5101.It Fl pubin
5102By default a private key is read from the input file:
5103with this option a public key is read instead.
5104.It Fl pubout
5105By default a private key is output:
5106with this option a public key will be output instead.
5107This option is automatically set if
5108the input is a public key.
5109.It Fl text
5110Print out the various public or private key components in
5111plain text in addition to the encoded version.
5112.It Fl text_pub
5113Print out only public key components
5114even if a private key is being processed.
5115.El
5116.Sh PKEY EXAMPLES
5117To remove the pass phrase on an RSA private key:
5118.Bd -literal -offset indent
5119$ openssl pkey -in key.pem -out keyout.pem
5120.Ed
5121.Pp
5122To encrypt a private key using triple DES:
5123.Bd -literal -offset indent
5124$ openssl pkey -in key.pem -des3 -out keyout.pem
5125.Ed
5126.Pp
5127To convert a private key from PEM to DER format:
5128.Bd -literal -offset indent
5129$ openssl pkey -in key.pem -outform DER -out keyout.der
5130.Ed
5131.Pp
5132To print the components of a private key to standard output:
5133.Bd -literal -offset indent
5134$ openssl pkey -in key.pem -text -noout
5135.Ed
5136.Pp
5137To print the public components of a private key to standard output:
5138.Bd -literal -offset indent
5139$ openssl pkey -in key.pem -text_pub -noout
5140.Ed
5141.Pp
5142To just output the public part of a private key:
5143.Bd -literal -offset indent
5144$ openssl pkey -in key.pem -pubout -out pubkey.pem
5145.Ed
5146.\"
5021.\" RAND 5147.\" RAND
5022.\" 5148.\"
5023.Sh RAND 5149.Sh RAND