<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Creating_Public_and_Private_Keys_with_OpenSSL</id>
		<title>Creating Public and Private Keys with OpenSSL - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=Creating_Public_and_Private_Keys_with_OpenSSL"/>
		<link rel="alternate" type="text/html" href="https://logicwiki.co.uk/index.php?title=Creating_Public_and_Private_Keys_with_OpenSSL&amp;action=history"/>
		<updated>2026-04-16T04:12:22Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://logicwiki.co.uk/index.php?title=Creating_Public_and_Private_Keys_with_OpenSSL&amp;diff=2243&amp;oldid=prev</id>
		<title>AliIybar: Created page with &quot;Category:SSL Category:Security == Preparation ==  in Windows : install WSL Ubuntu from [https://ubuntu.com/wsl https://ubuntu.com/wsl]  and install openssl   sudo apt...&quot;</title>
		<link rel="alternate" type="text/html" href="https://logicwiki.co.uk/index.php?title=Creating_Public_and_Private_Keys_with_OpenSSL&amp;diff=2243&amp;oldid=prev"/>
				<updated>2021-11-19T11:23:29Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php?title=Category:SSL&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:SSL (page does not exist)&quot;&gt;Category:SSL&lt;/a&gt; &lt;a href=&quot;/Category:Security&quot; title=&quot;Category:Security&quot;&gt;Category:Security&lt;/a&gt; == Preparation ==  in Windows : install WSL Ubuntu from [https://ubuntu.com/wsl https://ubuntu.com/wsl]  and install openssl   sudo apt...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:SSL]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
== Preparation == &lt;br /&gt;
in Windows : install WSL Ubuntu from [https://ubuntu.com/wsl https://ubuntu.com/wsl]&lt;br /&gt;
&lt;br /&gt;
and install openssl &lt;br /&gt;
 sudo apt install openssl&lt;br /&gt;
&lt;br /&gt;
== Generating an RSA Private Key Using OpenSSL ==&lt;br /&gt;
 openssl genrsa -out private-key.pem 3072&lt;br /&gt;
In this example, I have used a key length of 3072 bits. While 2048 is the minimum key length,  it is recommended that you use 3072. This gives you 128-bit security.&lt;br /&gt;
&lt;br /&gt;
This gives you a PEM file containing your RSA private key, which should look something like the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
MIIG4wIBAAKCAYEA1MSdsaPH2ShtjOo4c02+DbYcTdwUBLY+vNSXr2tV8/jGU059&lt;br /&gt;
... (I CUT THESE LINES TO MAKE IT SHORTER)&lt;br /&gt;
UuP3ai7zn++ag7Lu1QEm5pQAd2n+zMuKZbBISVA9fPbC9RkJX66E4zVbsEUnDDBD&lt;br /&gt;
9Rlu+3Dc0LwSjtAxXPDInmEh2mp3O/aZtMPVUPgDA4Ig7GbQC6W/&lt;br /&gt;
-----END RSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an RSA Public Key from a Private Key Using OpenSSL ==&lt;br /&gt;
 openssl rsa -in private-key.pem -pubout -out public-key.pem&lt;br /&gt;
&lt;br /&gt;
This should give you another PEM file, containing the public key:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-----BEGIN PUBLIC KEY-----&lt;br /&gt;
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1MSdsaPH2ShtjOo4c02+&lt;br /&gt;
... (I CUT THESE LINES TO MAKE IT SHORTER)&lt;br /&gt;
Snfpos7IxUTATpd6KTWUV3snVQnyiltCI1BHJC01sWePAgMBAAE=&lt;br /&gt;
-----END PUBLIC KEY-----&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an RSA Self-Signed Certificate Using OpenSSL ==&lt;br /&gt;
Now that you have a private key, you can use it to generate a self-signed certificate. This is not required, but it allows you to use the key for server/client authentication, or gain X509 specific functionality in technologies such as JWT and SAML.&lt;br /&gt;
 openssl req -new -x509 -key private-key.pem -out cert.pem -days 360&lt;br /&gt;
This will again generate yet another PEM file, this time containing the certificate created by your private key:&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIEazCCAtOgAwIB....&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You could leave things there, but often, when working on Windows, you will need to create a PFX file that contains both the certificate and the private key for you to export and use.&lt;br /&gt;
&lt;br /&gt;
You can do this using OpenSSL’s pkcs12 command:&lt;br /&gt;
 openssl pkcs12 -export -inkey private-key.pem -in cert.pem -out cert.pfx&lt;br /&gt;
OpenSSL will ask you to create a password for the PFX file. Feel free to leave this blank.&lt;br /&gt;
&lt;br /&gt;
This should leave you with a certificate that Windows can both install and export the RSA private key from.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------&lt;br /&gt;
see also : [https://ubuntu.com/wsl https://ubuntu.com/wsl]&lt;/div&gt;</summary>
		<author><name>AliIybar</name></author>	</entry>

	</feed>