use named links for each ident

This commit is contained in:
brent saner
2025-09-01 13:47:05 -04:00
parent 4b1cfd0c50
commit 1de61a888d
15 changed files with 154 additions and 123 deletions

View File

@@ -4,6 +4,7 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa"]
=== RSA
RSAfootnote:[https://datatracker.ietf.org/doc/html/rfc8017] is a widely-supported PKI system. It is ubiquitous, but it is recommended to use newer systems (e.g. ED25519) for OpenSSH if all clients and destinations support it.

View File

@@ -4,9 +4,10 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_priv_legc_crypt"]
===== Legacy (Encrypted)
[id=struct_rsa_crypt_legacy]
[id="bkdn_rsa_priv_legc_crypt_struct"]
====== Structure
Legacy private keys are encoded in standard RSA PEM format (https://datatracker.ietf.org/doc/html/rfc7468[RFC 7468^] § https://datatracker.ietf.org/doc/html/rfc7468#section-11[11^], https://datatracker.ietf.org/doc/html/rfc3447#appendix-A[APPENDIX-A^]).
@@ -14,7 +15,7 @@ Legacy private keys are encoded in standard RSA PEM format (https://datatracker.
The `Proc-Type` field is defined in https://datatracker.ietf.org/doc/html/rfc1421.html#section-4.6.1.1[RFC 1421 § 4.6.1.1^]. +
The `DEK-Info` field is defined in https://datatracker.ietf.org/doc/html/rfc1421.html#section-4.6.1.3[RFC 1421 § 4.6.1.3^].
[id=bytes_rsa_crypt_legacy]
[id="bkdn_rsa_priv_legc_crypt_ex"]
====== Example
The following example, being encrypted, is protected with a passphrase. The passphrase used in this example key is *`testpassword`*.
@@ -79,4 +80,4 @@ ftSfkGNUzTzPFbF5iEukTvKm42a7F/I/ExMVgpN/eQxJ7+m5TOgja0KC1h5fCN4L
-----END RSA PRIVATE KEY-----
----
See the <<bytes_rsa_plain_legacy, plaintext example>> for the decrypted (non-password-protected) version of this key.
See the <<bkdn_rsa_priv_legc_plain_ex, plaintext example>> for the decrypted (non-password-protected) version of this key.

View File

@@ -4,14 +4,15 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_priv_legc_plain"]
===== Legacy (Plain)
[id=struct_rsa_plain_legacy]
[id="bkdn_rsa_priv_legc_plain_struct"]
====== Structure
Legacy private keys are encoded in standard RSA PEM format (https://datatracker.ietf.org/doc/html/rfc7468[RFC 7468^] § https://datatracker.ietf.org/doc/html/rfc7468#section-10[10^], https://datatracker.ietf.org/doc/html/rfc3447#appendix-A[APPENDIX-A^]).
[id=bytes_rsa_plain_legacy]
[id="bkdn_rsa_priv_legc_plain_ex"]
====== Example
[source,text,linenums]

View File

@@ -4,6 +4,7 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_priv"]
==== Private
include::legacy/main.adoc[]

View File

@@ -4,6 +4,7 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_priv_v1_crypt"]
===== v1 (Encrypted)
[TIP]
@@ -40,7 +41,7 @@ This is likely going to be:
The author recommends using `aes256-ctr`. It is currently the upstream default.
====
[id=struct_rsa_crypt]
[id="bkdn_rsa_priv_v1_crypt_struct"]
====== Structure
[source,text,linenums]
@@ -71,10 +72,10 @@ The author recommends using `aes256-ctr`. It is currently the upstream default.
====
*Chunk 4.0:* This is technically currently unused; upstream hardcodes to 1 (left zero-padded 0x01).
*Chunk 4.0.1.0:* When decrypted, this is equivalent to the <<struct_rsa_plain,plaintext>> *4.0.1.0* to *4.0.1.10*. It uses a padded size appropriate to the encryption cipher used.
*Chunk 4.0.1.0:* When decrypted, this is equivalent to the <<bkdn_rsa_priv_v1_plain_struct, plaintext>> *4.0.1.0* to *4.0.1.10*. It uses a padded size appropriate to the encryption cipher used.
====
[id=bytes_rsa_crypt]
[id="bkdn_rsa_priv_v1_crypt_ex"]
====== Example
The following example, being encrypted, is protected with a passphrase. The passphrase used in this example key is *`test`*.
@@ -234,7 +235,7 @@ ZnrXZl+8QIW1MSvaaQFmJFqTs=
[NOTE]
====
The decrypted *4.0.1.0* should match the <<struct_rsa_plain, plaintext key's structure>> for *4.0.1.0* through *4.0.1.10*. The padding length WILL change, however, between the two unless using a cipher with an 8-byte block size.
The decrypted *4.0.1.0* should match the <<bkdn_rsa_priv_v1_plain_ex, plaintext key's structure>> for *4.0.1.0* through *4.0.1.10*. The padding length WILL change, however, between the two unless using a cipher with an 8-byte block size.
====
When *4.0.1.0* is decrypted, it yields:
@@ -317,4 +318,4 @@ When *4.0.1.0* is decrypted, it yields:
4.0.1.10 010203 ([1 2 3], 3 bytes)
----
See the <<struct_rsa_plain, plaintext structure>> for details.
See the <<bkdn_rsa_priv_v1_plain_struct, plaintext structure>> for details.

View File

@@ -4,6 +4,7 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_priv_v1_plain"]
===== v1 (Plain)
[TIP]
@@ -11,7 +12,7 @@ http://creativecommons.org/licenses/by-sa/4.0/.
Since plaintext/unencrypted keys do not have a cipher or KDF (as there's no encryption key or algorithm used), they use the string "none" to identify these (and entirely leave out the KDF options).
====
[id=struct_rsa_plain]
[id="bkdn_rsa_priv_v1_plain_struct"]
====== Structure
[source,text,linenums]
@@ -54,7 +55,7 @@ Since plaintext/unencrypted keys do not have a cipher or KDF (as there's no encr
[NOTE]
====
*Chunk 3.0.0 to 3.0.1:* These blocks are not present in unencrypted keys (see the <<struct_rsa_crypt, encrypted key structure>> for what these look like). *3.0* reflects this, as it's always going to be `00000000` (0).
*Chunk 3.0.0 to 3.0.1:* These blocks are not present in unencrypted keys (see the <<bkdn_rsa_priv_v1_crypt_struct, encrypted key structure>> for what these look like). *3.0* reflects this, as it's always going to be `00000000` (0).
*Chunk 4.0:* This is technically currently unused; upstream hardcodes to 1 (left zero-padded 0x01).
@@ -63,7 +64,7 @@ Since plaintext/unencrypted keys do not have a cipher or KDF (as there's no encr
*Chunk 4.0.1.10:* The padding used aligns the private key (*4.0.1.0* to *4.0.1.9.0*) to the cipher blocksize. For plaintext keys, a blocksize of 8 is used.
====
[id=bytes_rsa_plain]
[id="bkdn_rsa_priv_v1_plain_ex"]
====== Example
The following example, being encrypted, is protected with a passphrase. The passphrase used in this example key is *`test`*.

View File

@@ -4,8 +4,10 @@ To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
////
[id="bkdn_rsa_pub"]
==== Public
[id="bkdn_rsa_pub_struct"]
===== Structure
Public keys are stored in the following structure:
@@ -21,6 +23,7 @@ Public keys are stored in the following structure:
2.0 modulus ('n') (bytes)
----
[id="bkdn_rsa_pub_ex"]
===== Example
.`.pub` format