Skip to content

Commit 9c531c3

Browse files
committed
clearifiy pem format
1 parent 8bad86c commit 9c531c3

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

docs/certificates.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@
2525
- .pfx - pkcs12
2626
- .csr (certificate signing request): temporary
2727

28+
### more on pem
29+
30+
A PEM file looks like this:
31+
32+
```
33+
-----BEGIN [TYPE OF DATA]-----
34+
[Base64 encoded binary data]
35+
-----END [TYPE OF DATA]-----
36+
```
37+
38+
The [TYPE OF DATA] part indicates the format of the binary data within the base64 block. This is where PKCS#1, PKCS#8, and OpenSSH formats come into play for private keys.
39+
40+
- PKCS#1 PEM Format (-----BEGIN RSA PRIVATE KEY-----) - : PKCS#1 (Public-Key Cryptography Standards #1) specifically defines the syntax for RSA public and private keys
41+
- PKCS#8 PEM Format (-----BEGIN PRIVATE KEY----- or -----BEGIN ENCRYPTED PRIVATE KEY-----) - PKCS#8 (Private-Key Information Syntax Specification) is a more generic standard for storing private keys for any public-key algorithm, not just RSA.
42+
- OpenSSH Private Key Format (-----BEGIN OPENSSH PRIVATE KEY-----) - This is a custom, OpenSSH-specific format, introduced in OpenSSH 7.8 (released in 2017).
43+
44+
2845
## default locations
2946

3047
### Linux

docs/linux (debian based)/network_ssh.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ chmod 644 ~/.ssh/id_ed25519.pub
1818
chmod 600 ~/.ssh/id_ed25519
1919
```
2020

21-
If the "-----BEGIN OPENSSH PRIVATE KEY-----" format is not accepted use plain openssl cli:
22-
23-
```shell
24-
openssl genpkey -algorithm ed25519 -out key.pem
25-
openssl pkey -in key.pem -pubout -out public.pem
26-
27-
# or for rsa
28-
openssl genrsa -out key.pem 4096
29-
openssl rsa -in key.pem -out pubkey.pem -outform PEM -pubout
30-
```
31-
3221
## connect via ssh
3322

3423
```shell

0 commit comments

Comments
 (0)