forked from lazerwalker/fuckingblocksyntax.com
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
157 lines (129 loc) · 4.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<title>How Do I Convert Certificates With OpenSSL?</title>
<style>
body {
background-color: #002b36;
color: #839496;
font-family: Lucida Grande, sans-serif;
font-size: 20px;
padding: 40px;
padding-bottom: 0;
}
strong {
color: #268bd2;
}
h1 {
font-size: 40px;
margin-bottom: 1.5em;
text-align: center;
}
h2 {
font-weight: normal;
}
.openssl {
color: #2aa198;
}
.file-in {
color: #BC8800;
}
.file-out, .parameters {
color: #7C9F00;
}
.disclaimer {
line-height: 2em;
}
code {
display: block;
font-family: Monaco, Menlo;
font-size: 20px;
margin-bottom: 3em;
margin-left: 40px;
margin-top: 1.5em;
}
footer {
font-size: 12px;
margin-top: 200px;
opacity: 0.4;
text-align: right;
}
a {
color: #0088D9;
text-decoration: none;
}
</style>
<style media="print">
body {
background-color: #FFFFFF;
font-size: 16px;
padding: 20px;
}
h1 {
font-size: 28px;
margin-bottom: 1em;
}
code {
font-size: 16px;
margin-bottom: 2em;
margin-left: 20px;
}
footer {
font-size: 10px;
margin-top: 40px;
}
</style>
</head>
<body>
<h1>How Do I Convert Certificates With OpenSSL?</h1>
<div>
<h2>Create a <strong>rsa key</strong>:</h2>
<code>
openssl <span class="openssl">genrsa <span class="openssl">-out</span> <span class="file-out">sample.key</span> <span class="openssl">4096</span>
</code>
</div>
<div>
<h2>Convert <strong>.crt (and private key) to .p12</strong>:</h2>
<code>
openssl <span class="openssl">pkcs12 -export -in</span> <span class="file-in">sample.crt</span> <span class="openssl">-inkey</span> <span class="file-in">sample.key</span> <span class="openssl">-out</span> <span class="file-out">sample.p12</span>
</code>
</div>
<div>
<h2>Convert <strong>.pem to .der</strong>:</h2>
<code>
openssl <span class="openssl">x509 -outform der -in </span> <span class="file-in">sample.pem</span> <span class="openssl">-out</span> <span class="file-out">sample.der</span>
</code>
</div>
<div>
<h2>Convert <strong>.der to .pem</strong>:</h2>
<code>
openssl <span class="openssl">x509 -inform der -in </span> <span class="file-in">sample.der</span> <span class="openssl">-out</span> <span class="file-out">sample.pem</span>
</code>
</div>
<div>
<h2>Convert <strong>.p12 to .key</strong>:</h2>
<code>
openssl <span class="openssl">pkcs12 -in </span> <span class="file-in">sample.p12</span> <span class="openssl">-nocerts -out</span> <span class="file-out">sample.key</span>
</code>
</div>
<div>
<h2>Convert <strong>.p12 to .crt</strong>:</h2>
<code>
openssl <span class="openssl">pkcs12 -in </span> <span class="file-in">sample.p12</span> <span class="openssl">-clcerts -nokeys -out</span> <span class="file-out">sample.crt</span>
</code>
</div>
<div class="disclaimer">
This site is not intended to be an exhaustive list of all possible commands.<br>
If you find yourself needing commands not listed here, simply create a pull request at <a href="https://github.com/hirschfl/fuckingopensslcommands.com">GitHub</a>.
</div>
<footer>By <a href="https://github.com/hirschfl">Florian Hirschmann</a>, who has a very bad memory for this kind of thing. <br>Original idea and website design by <a href="http://lazerwalker.com">Mike Lazer-Walker</a>, who has a similar bad memory for <a href="http://fuckingblocksyntax.com/">block syntax</a></footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-71613877-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>