<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Fmake%2FLinux_PKI_Makefile</id>
	<title>Linux/make/Linux PKI Makefile - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Linux%2Fmake%2FLinux_PKI_Makefile"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Linux/make/Linux_PKI_Makefile&amp;action=history"/>
	<updated>2026-05-07T03:51:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Linux/make/Linux_PKI_Makefile&amp;diff=664&amp;oldid=prev</id>
		<title>Kenneth: Created page with &quot;/etc/pki/tls/certs/Makefile  &lt;pre&gt; UTF8 := $(shell locale -c LC_CTYPE -k | grep -q charmap.*UTF-8 &amp;&amp; echo -utf8) SERIAL=0  .PHONY: usage .SUFFIXES: .key .csr .crt .pem .PRECIO...&quot;</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Linux/make/Linux_PKI_Makefile&amp;diff=664&amp;oldid=prev"/>
		<updated>2014-08-11T02:07:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;/etc/pki/tls/certs/Makefile  &amp;lt;pre&amp;gt; UTF8 := $(shell locale -c LC_CTYPE -k | grep -q charmap.*UTF-8 &amp;amp;&amp;amp; echo -utf8) SERIAL=0  .PHONY: usage .SUFFIXES: .key .csr .crt .pem .PRECIO...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;/etc/pki/tls/certs/Makefile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UTF8 := $(shell locale -c LC_CTYPE -k | grep -q charmap.*UTF-8 &amp;amp;&amp;amp; echo -utf8)&lt;br /&gt;
SERIAL=0&lt;br /&gt;
&lt;br /&gt;
.PHONY: usage&lt;br /&gt;
.SUFFIXES: .key .csr .crt .pem&lt;br /&gt;
.PRECIOUS: %.key %.csr %.crt %.pem&lt;br /&gt;
&lt;br /&gt;
usage:&lt;br /&gt;
        @echo &amp;quot;This makefile allows you to create:&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  o public/private key pairs&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  o SSL certificate signing requests (CSRs)&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  o self-signed SSL test certificates&amp;quot;&lt;br /&gt;
        @echo&lt;br /&gt;
        @echo &amp;quot;To create a key pair, run \&amp;quot;make SOMETHING.key\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo &amp;quot;To create a CSR, run \&amp;quot;make SOMETHING.csr\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo &amp;quot;To create a test certificate, run \&amp;quot;make SOMETHING.crt\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo &amp;quot;To create a key and a test certificate in one file, run \&amp;quot;make SOMETHING.pem\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo&lt;br /&gt;
        @echo &amp;quot;To create a key for use with Apache, run \&amp;quot;make genkey\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo &amp;quot;To create a CSR for use with Apache, run \&amp;quot;make certreq\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo &amp;quot;To create a test certificate for use with Apache, run \&amp;quot;make testcert\&amp;quot;.&amp;quot;&lt;br /&gt;
        @echo&lt;br /&gt;
        @echo &amp;quot;To create a test certificate with serial number other than zero, add SERIAL=num&amp;quot;&lt;br /&gt;
        @echo&lt;br /&gt;
        @echo Examples:&lt;br /&gt;
        @echo &amp;quot;  make server.key&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make server.csr&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make server.crt&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make stunnel.pem&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make genkey&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make certreq&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make testcert&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make server.crt SERIAL=1&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make stunnel.pem SERIAL=2&amp;quot;&lt;br /&gt;
        @echo &amp;quot;  make testcert SERIAL=3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
%.pem:&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \&lt;br /&gt;
        PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \&lt;br /&gt;
        /usr/bin/openssl req $(UTF8) -newkey rsa:1024 -keyout $$PEM1 -nodes -x509 -days 365 -out $$PEM2 -set_serial $(SERIAL) ; \&lt;br /&gt;
        cat $$PEM1 &amp;gt;  $@ ; \&lt;br /&gt;
        echo &amp;quot;&amp;quot;    &amp;gt;&amp;gt; $@ ; \&lt;br /&gt;
        cat $$PEM2 &amp;gt;&amp;gt; $@ ; \&lt;br /&gt;
        $(RM) $$PEM1 $$PEM2&lt;br /&gt;
&lt;br /&gt;
%.key:&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        /usr/bin/openssl genrsa -des3 1024 &amp;gt; $@&lt;br /&gt;
&lt;br /&gt;
%.csr: %.key&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        /usr/bin/openssl req $(UTF8) -new -key $^ -out $@&lt;br /&gt;
&lt;br /&gt;
%.crt: %.key&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        /usr/bin/openssl req $(UTF8) -new -key $^ -x509 -days 365 -out $@ -set_serial $(SERIAL)&lt;br /&gt;
&lt;br /&gt;
TLSROOT=/etc/pki/tls&lt;br /&gt;
KEY=$(TLSROOT)/private/localhost.key&lt;br /&gt;
CSR=$(TLSROOT)/certs/localhost.csr&lt;br /&gt;
CRT=$(TLSROOT)/certs/localhost.crt&lt;br /&gt;
&lt;br /&gt;
genkey: $(KEY)&lt;br /&gt;
certreq: $(CSR)&lt;br /&gt;
testcert: $(CRT)&lt;br /&gt;
&lt;br /&gt;
$(CSR): $(KEY)&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        /usr/bin/openssl req $(UTF8) -new -key $(KEY) -out $(CSR)&lt;br /&gt;
&lt;br /&gt;
$(CRT): $(KEY)&lt;br /&gt;
        umask 77 ; \&lt;br /&gt;
        /usr/bin/openssl req $(UTF8) -new -key $(KEY) -x509 -days 365 -out $(CRT) -set_serial $(SERIAL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== keywords ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>