PEM encoded RSA private key
From Just Solve the File Format Problem
				
								
				(Difference between revisions)
				
																
				
				
								
				m  | 
			|||
| Line 8: | Line 8: | ||
A public key can be derived from the private key, and the public key may be associated with one or more [[PEM encoded certificate|certificate]] files.  | A public key can be derived from the private key, and the public key may be associated with one or more [[PEM encoded certificate|certificate]] files.  | ||
| − | See also [[PEM]]  | + | == See also ==  | 
| + | * [[DER encoded RSA private key]]  | ||
| + | * [[PEM]]  | ||
== Identification ==  | == Identification ==  | ||
Revision as of 23:55, 19 October 2013
PEM encoded RSA private key is a format that stores a private key, for use with cryptographic systems such as SSL.
A public key can be derived from the private key, and the public key may be associated with one or more certificate files.
Contents | 
See also
Identification
A key file is plain text, with base64-encoded payload data. It contains a line that reads "-----BEGIN RSA PRIVATE KEY-----".
Examples
To view the contents of a key, using OpenSSL:
openssl rsa -noout -text -in example.key
(This mostly just prints out opaque numbers, but note that the modulus can be used to determine whether the key corresponds to a particular certificate.)
To generate a new private key:
openssl genrsa 2048 > example.key
To add a password to an existing private key:
openssl rsa -des3 -in unprotected.key > protected.key
To remove a password from an existing private key:
openssl rsa -in protected.key > unprotected.key