218 lines
		
	
	
		
			7.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
		
		
			
		
	
	
			218 lines
		
	
	
		
			7.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| 
								 | 
							
								<?xml version="1.0" ?>
							 | 
						||
| 
								 | 
							
								<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
							 | 
						||
| 
								 | 
							
								<html xmlns="http://www.w3.org/1999/xhtml">
							 | 
						||
| 
								 | 
							
								<head>
							 | 
						||
| 
								 | 
							
								<title>pkey</title>
							 | 
						||
| 
								 | 
							
								<meta http-equiv="content-type" content="text/html; charset=utf-8" />
							 | 
						||
| 
								 | 
							
								<link rev="made" href="mailto:root@localhost" />
							 | 
						||
| 
								 | 
							
								</head>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<body style="background-color: white">
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<!-- INDEX BEGIN -->
							 | 
						||
| 
								 | 
							
								<div name="index">
							 | 
						||
| 
								 | 
							
								<p><a name="__index__"></a></p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<ul>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									<li><a href="#name">NAME</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#synopsis">SYNOPSIS</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#description">DESCRIPTION</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#options">OPTIONS</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#examples">EXAMPLES</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#see_also">SEE ALSO</a></li>
							 | 
						||
| 
								 | 
							
									<li><a href="#copyright">COPYRIGHT</a></li>
							 | 
						||
| 
								 | 
							
								</ul>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<hr name="index" />
							 | 
						||
| 
								 | 
							
								</div>
							 | 
						||
| 
								 | 
							
								<!-- INDEX END -->
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="name">NAME</a></h1>
							 | 
						||
| 
								 | 
							
								<p>openssl-pkey,
							 | 
						||
| 
								 | 
							
								pkey - public or private key processing tool</p>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="synopsis">SYNOPSIS</a></h1>
							 | 
						||
| 
								 | 
							
								<p><strong>openssl</strong> <strong>pkey</strong>
							 | 
						||
| 
								 | 
							
								[<strong>-help</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-inform PEM|DER</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-outform PEM|DER</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-in filename</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-passin arg</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-out filename</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-passout arg</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-traditional</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-<em>cipher</em></strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-text</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-text_pub</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-noout</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-pubin</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-pubout</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-engine id</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-check</strong>]
							 | 
						||
| 
								 | 
							
								[<strong>-pubcheck</strong>]</p>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="description">DESCRIPTION</a></h1>
							 | 
						||
| 
								 | 
							
								<p>The <strong>pkey</strong> command processes public or private keys. They can be converted
							 | 
						||
| 
								 | 
							
								between various forms and their components printed out.</p>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="options">OPTIONS</a></h1>
							 | 
						||
| 
								 | 
							
								<dl>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="help" class="item"><strong>-help</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Print out a usage message.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="inform_der_pem" class="item"><strong>-inform DER|PEM</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This specifies the input format DER or PEM. The default format is PEM.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="outform_der_pem" class="item"><strong>-outform DER|PEM</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This specifies the output format, the options have the same meaning and default
							 | 
						||
| 
								 | 
							
								as the <strong>-inform</strong> option.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="in_filename" class="item"><strong>-in filename</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This specifies the input filename to read a key from or standard input if this
							 | 
						||
| 
								 | 
							
								option is not specified. If the key is encrypted a pass phrase will be
							 | 
						||
| 
								 | 
							
								prompted for.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="passin_arg" class="item"><strong>-passin arg</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>The input file password source. For more information about the format of <strong>arg</strong>
							 | 
						||
| 
								 | 
							
								see the <strong>PASS PHRASE ARGUMENTS</strong> section in <em>openssl(1)</em>.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="out_filename" class="item"><strong>-out filename</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This specifies the output filename to write a key to or standard output if this
							 | 
						||
| 
								 | 
							
								option is not specified. If any encryption options are set then a pass phrase
							 | 
						||
| 
								 | 
							
								will be prompted for. The output filename should <strong>not</strong> be the same as the input
							 | 
						||
| 
								 | 
							
								filename.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="passout_password" class="item"><strong>-passout password</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>The output file password source. For more information about the format of <strong>arg</strong>
							 | 
						||
| 
								 | 
							
								see the <strong>PASS PHRASE ARGUMENTS</strong> section in <em>openssl(1)</em>.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="traditional" class="item"><strong>-traditional</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Normally a private key is written using standard format: this is PKCS#8 form
							 | 
						||
| 
								 | 
							
								with the appropriate encryption algorithm (if any). If the <strong>-traditional</strong>
							 | 
						||
| 
								 | 
							
								option is specified then the older "traditional" format is used instead.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="cipher" class="item"><strong>-<em>cipher</em></strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>These options encrypt the private key with the supplied cipher. Any algorithm
							 | 
						||
| 
								 | 
							
								name accepted by <code>EVP_get_cipherbyname()</code> is acceptable such as <strong>des3</strong>.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="text" class="item"><strong>-text</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Prints out the various public or private key components in
							 | 
						||
| 
								 | 
							
								plain text in addition to the encoded version.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="text_pub" class="item"><strong>-text_pub</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Print out only public key components even if a private key is being processed.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="noout" class="item"><strong>-noout</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Do not output the encoded version of the key.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="pubin" class="item"><strong>-pubin</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>By default a private key is read from the input file: with this
							 | 
						||
| 
								 | 
							
								option a public key is read instead.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="pubout" class="item"><strong>-pubout</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>By default a private key is output: with this option a public
							 | 
						||
| 
								 | 
							
								key will be output instead. This option is automatically set if
							 | 
						||
| 
								 | 
							
								the input is a public key.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="engine_id" class="item"><strong>-engine id</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>Specifying an engine (by its unique <strong>id</strong> string) will cause <strong>pkey</strong>
							 | 
						||
| 
								 | 
							
								to attempt to obtain a functional reference to the specified engine,
							 | 
						||
| 
								 | 
							
								thus initialising it if needed. The engine will then be set as the default
							 | 
						||
| 
								 | 
							
								for all available algorithms.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="check" class="item"><strong>-check</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This option checks the consistency of a key pair for both public and private
							 | 
						||
| 
								 | 
							
								components.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								<dt><strong><a name="pubcheck" class="item"><strong>-pubcheck</strong></a></strong></dt>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<dd>
							 | 
						||
| 
								 | 
							
								<p>This option checks the correctness of either a public key or the public component
							 | 
						||
| 
								 | 
							
								of a key pair.</p>
							 | 
						||
| 
								 | 
							
								</dd>
							 | 
						||
| 
								 | 
							
								</dl>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="examples">EXAMPLES</a></h1>
							 | 
						||
| 
								 | 
							
								<p>To remove the pass phrase on an RSA private key:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -out keyout.pem</pre>
							 | 
						||
| 
								 | 
							
								<p>To encrypt a private key using triple DES:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -des3 -out keyout.pem</pre>
							 | 
						||
| 
								 | 
							
								<p>To convert a private key from PEM to DER format:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -outform DER -out keyout.der</pre>
							 | 
						||
| 
								 | 
							
								<p>To print out the components of a private key to standard output:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -text -noout</pre>
							 | 
						||
| 
								 | 
							
								<p>To print out the public components of a private key to standard output:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -text_pub -noout</pre>
							 | 
						||
| 
								 | 
							
								<p>To just output the public part of a private key:</p>
							 | 
						||
| 
								 | 
							
								<pre>
							 | 
						||
| 
								 | 
							
								 openssl pkey -in key.pem -pubout -out pubkey.pem</pre>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="see_also">SEE ALSO</a></h1>
							 | 
						||
| 
								 | 
							
								<p><em>genpkey(1)</em>, <em>rsa(1)</em>, <em>pkcs8(1)</em>,
							 | 
						||
| 
								 | 
							
								<em>dsa(1)</em>, <em>genrsa(1)</em>, <em>gendsa(1)</em></p>
							 | 
						||
| 
								 | 
							
								<p>
							 | 
						||
| 
								 | 
							
								</p>
							 | 
						||
| 
								 | 
							
								<hr />
							 | 
						||
| 
								 | 
							
								<h1><a name="copyright">COPYRIGHT</a></h1>
							 | 
						||
| 
								 | 
							
								<p>Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved.</p>
							 | 
						||
| 
								 | 
							
								<p>Licensed under the OpenSSL license (the "License").  You may not use
							 | 
						||
| 
								 | 
							
								this file except in compliance with the License.  You can obtain a copy
							 | 
						||
| 
								 | 
							
								in the file LICENSE in the source distribution or at
							 | 
						||
| 
								 | 
							
								<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								</body>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								</html>
							 |