Skip to content

Commit 53d1660

Browse files
committed
Clean up the docs references as well
1 parent 0d95324 commit 53d1660

14 files changed

+83
-83
lines changed

Sources/X509/Docs.docc/Creating Certificates.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ certificate. For self-signed certificates, the issuer and the subject are identi
8484
The bulk of the semantic information in a certificate is contained in its extensions. For our case, we care about only a small
8585
few.
8686

87-
We need ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum`` to be present, and set to
88-
`isCertificateAuthority`. We also need ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct`` with the appropriate bits
89-
set. Finally, we want to set ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct`` to include the domain
87+
We need ``BasicConstraints`` to be present, and set to
88+
`isCertificateAuthority`. We also need ``KeyUsage`` with the appropriate bits
89+
set. Finally, we want to set ``SubjectAlternativeNames`` to include the domain
9090
name we're going to be self-signing for, which in this case we'll set to `localhost`.
9191

9292
We can use the helpful builder syntax for this:

Sources/X509/Docs.docc/Examining Certificates.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ bytes in an extension, as well as wrap themselves back into the opaque ``Certifi
9999

100100
Out of the box, ``X509`` ships support for the following extension types:
101101

102-
- ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct``
103-
- ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct``
104-
- ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum``
105-
- ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``
106-
- ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct``
107-
- ``Certificate/Extensions-swift.struct/NameConstraints-swift.struct``
108-
- ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct``
109-
- ``Certificate/Extensions-swift.struct/SubjectKeyIdentifier-swift.struct``
102+
- ``AuthorityInformationAccess``
103+
- ``AuthorityKeyIdentifier``
104+
- ``BasicConstraints``
105+
- ``ExtendedKeyUsage``
106+
- ``KeyUsage``
107+
- ``NameConstraints``
108+
- ``SubjectAlternativeNames``
109+
- ``SubjectKeyIdentifier``
110110

111111
To decode an extension usually requires examining its ``Certificate/Extension/oid`` field. For example, to search
112-
for the ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct``, the typical code would be:
112+
for the ``SubjectAlternativeNames``, the typical code would be:
113113

114114
```swift
115115
let opaqueSANExtension = certificate.extensions.first(where: { $0.oid == .X509ExtensionID.subjectAlternativeName })
@@ -130,14 +130,14 @@ if let opaqueSanExtension = certificate.extensions[oid: .X509ExtensionID.subject
130130
This pattern is itself still somewhat repetitive, so ``Certificate/Extensions-swift.struct`` offers a number of helper properties
131131
that can be used to get a specific typed extension:
132132

133-
- ``Certificate/Extensions-swift.struct/authorityInformationAccess-swift.property``
134-
- ``Certificate/Extensions-swift.struct/authorityKeyIdentifier-swift.property``
135-
- ``Certificate/Extensions-swift.struct/basicConstraints-swift.property``
136-
- ``Certificate/Extensions-swift.struct/extendedKeyUsage-swift.property``
137-
- ``Certificate/Extensions-swift.struct/keyUsage-swift.property``
138-
- ``Certificate/Extensions-swift.struct/nameConstraints-swift.property``
139-
- ``Certificate/Extensions-swift.struct/subjectAlternativeNames-swift.property``
140-
- ``Certificate/Extensions-swift.struct/subjectKeyIdentifier-swift.property``
133+
- ``Certificate/Extensions-swift.struct/authorityInformationAccess``
134+
- ``Certificate/Extensions-swift.struct/authorityKeyIdentifier``
135+
- ``Certificate/Extensions-swift.struct/basicConstraints``
136+
- ``Certificate/Extensions-swift.struct/extendedKeyUsage``
137+
- ``Certificate/Extensions-swift.struct/keyUsage``
138+
- ``Certificate/Extensions-swift.struct/nameConstraints``
139+
- ``Certificate/Extensions-swift.struct/subjectAlternativeNames``
140+
- ``Certificate/Extensions-swift.struct/subjectKeyIdentifier``
141141

142142
This lets us reduce the above code to a single line:
143143

Sources/X509/Docs.docc/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ certificate authorities, authenticating peers, and more.
4747

4848
### Supported Extension Types
4949

50-
- ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct``
51-
- ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct``
52-
- ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum``
53-
- ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``
54-
- ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct``
55-
- ``Certificate/Extensions-swift.struct/NameConstraints-swift.struct``
56-
- ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct``
57-
- ``Certificate/Extensions-swift.struct/SubjectKeyIdentifier-swift.struct``
50+
- ``AuthorityInformationAccess``
51+
- ``AuthorityKeyIdentifier``
52+
- ``BasicConstraints``
53+
- ``ExtendedKeyUsage``
54+
- ``KeyUsage``
55+
- ``NameConstraints``
56+
- ``SubjectAlternativeNames``
57+
- ``SubjectKeyIdentifier``
5858
- ``Critical``
5959

6060
### Names

Sources/X509/Extension Types/AuthorityInformationAccess.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import SwiftASN1
1616

1717
/// Provides details on how to access information about the certificate issuer.
1818
///
19-
/// This extension behaves as a collection of ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct/AccessDescription`` objects.
19+
/// This extension behaves as a collection of ``AuthorityInformationAccess/AccessDescription`` objects.
2020
///
2121
/// In practice this most commonly contains OCSP servers and links to the issuing CA certificate.
2222
public struct AuthorityInformationAccess {
2323
@usableFromInline
2424
var descriptions: [AccessDescription]
2525

26-
/// Create a new ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct/`` object
26+
/// Create a new ``AuthorityInformationAccess/`` object
2727
/// containing specific access descriptions.
2828
///
2929
/// - Parameter descriptions: The descriptions to include in the AIA extension.
@@ -32,7 +32,7 @@ public struct AuthorityInformationAccess {
3232
self.descriptions = Array(descriptions)
3333
}
3434

35-
/// Create a new ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct`` object
35+
/// Create a new ``AuthorityInformationAccess`` object
3636
/// by unwrapping a ``Certificate/Extension``.
3737
///
3838
/// - Parameter ext: The ``Certificate/Extension`` to unwrap
@@ -93,7 +93,7 @@ extension AuthorityInformationAccess {
9393
/// The location where the information may be found.
9494
public var location: GeneralName
9595

96-
/// Construct a new ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct/AccessDescription`` from constituent parts.
96+
/// Construct a new ``AuthorityInformationAccess/AccessDescription`` from constituent parts.
9797
@inlinable
9898
public init(method: AccessMethod, location: GeneralName) {
9999
self.method = method
@@ -120,7 +120,7 @@ extension AuthorityInformationAccess.AccessDescription: CustomStringConvertible
120120

121121
extension AuthorityInformationAccess.AccessDescription {
122122
/// The format and meaning of the information included in a single
123-
/// ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct/AccessDescription``
123+
/// ``AuthorityInformationAccess/AccessDescription``
124124
/// object.
125125
public struct AccessMethod {
126126
@usableFromInline

Sources/X509/Extension Types/AuthorityKeyIdentifier.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public struct AuthorityKeyIdentifier {
2929
/// The serial number of the issuing cert.
3030
public var authorityCertSerialNumber: Certificate.SerialNumber?
3131

32-
/// Create a new ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct`` extension value.
32+
/// Create a new ``AuthorityKeyIdentifier`` extension value.
3333
///
3434
/// - Parameters:
3535
/// - keyIdentifier: An opaque sequence of bytes uniquely derived from the public key of the issuing CA.
@@ -42,7 +42,7 @@ public struct AuthorityKeyIdentifier {
4242
self.authorityCertSerialNumber = authorityCertSerialNumber
4343
}
4444

45-
/// Create a new ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct`` object
45+
/// Create a new ``AuthorityKeyIdentifier`` object
4646
/// by unwrapping a ``Certificate/Extension``.
4747
///
4848
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension Types/BasicConstraints.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public enum BasicConstraints {
2929
/// certificate.
3030
case notCertificateAuthority
3131

32-
/// Create a new ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum`` object
32+
/// Create a new ``BasicConstraints`` object
3333
/// by unwrapping a ``Certificate/Extension``.
3434
///
3535
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension Types/ExtendedKeyUsage.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import SwiftASN1
1616

1717
/// Indicates one or more purposes for which the certified public key
1818
/// may be used, in addition to or instead of the the purposes indicated
19-
/// in the ``KeyUsage-swift.struct`` extension.
19+
/// in the ``KeyUsage`` extension.
2020
public struct ExtendedKeyUsage {
2121
@usableFromInline
2222
var usages: [Usage]
2323

24-
/// Construct an ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct`` extension containing the
24+
/// Construct an ``ExtendedKeyUsage`` extension containing the
2525
/// given usages.
2626
///
2727
/// - Parameter usages: The purposes for which the certificate may be used.
@@ -30,7 +30,7 @@ public struct ExtendedKeyUsage {
3030
self.usages = Array(usages)
3131
}
3232

33-
/// Create a new ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct`` object
33+
/// Create a new ``ExtendedKeyUsage`` object
3434
/// by unwrapping a ``Certificate/Extension``.
3535
///
3636
/// - Parameter ext: The ``Certificate/Extension`` to unwrap
@@ -82,7 +82,7 @@ extension ExtendedKeyUsage: RandomAccessCollection {
8282

8383
extension ExtendedKeyUsage {
8484
/// An acceptable usage for a certificate as attested in an
85-
/// ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``
85+
/// ``ExtendedKeyUsage``
8686
/// extension.
8787
public struct Usage {
8888
@usableFromInline
@@ -106,7 +106,7 @@ extension ExtendedKeyUsage {
106106
self.backing = backing
107107
}
108108

109-
/// Constructs a ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct/Usage`` from an opaque oid.
109+
/// Constructs a ``ExtendedKeyUsage/Usage`` from an opaque oid.
110110
///
111111
/// - Parameter oid: The OID of the usage.
112112
@inlinable
@@ -242,7 +242,7 @@ extension ASN1ObjectIdentifier {
242242
}
243243

244244
/// An acceptable usage for a certificate as attested in an
245-
/// ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``
245+
/// ``ExtendedKeyUsage``
246246
/// extension.
247247
public enum ExtendedKeyUsage {
248248
/// The public key may be used for any purpose.

Sources/X509/Extension Types/ExtensionIdentifiers.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,35 @@ extension ASN1ObjectIdentifier {
1818
/// OIDs that identify known X509 extensions.
1919
public enum X509ExtensionID {
2020
/// Identifies the authority key identifier extension, corresponding to
21-
/// ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct``.
21+
/// ``AuthorityKeyIdentifier``.
2222
public static let authorityKeyIdentifier: ASN1ObjectIdentifier = [2, 5, 29, 35]
2323

2424
/// Identifies the subject key identifier extension, corresponding to
25-
/// ``Certificate/Extensions-swift.struct/SubjectKeyIdentifier-swift.struct``.
25+
/// ``SubjectKeyIdentifier``.
2626
public static let subjectKeyIdentifier: ASN1ObjectIdentifier = [2, 5, 29, 14]
2727

2828
/// Identifies the key usgae extension, corresponding to
29-
/// ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct``.
29+
/// ``KeyUsage``.
3030
public static let keyUsage: ASN1ObjectIdentifier = [2, 5, 29, 15]
3131

3232
/// Identifies the subject alternative name extension, corresponding to
33-
/// ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct``.
33+
/// ``SubjectAlternativeNames``.
3434
public static let subjectAlternativeName: ASN1ObjectIdentifier = [2, 5, 29, 17]
3535

3636
/// Identifies the basic constraints extension, corresponding to
37-
/// ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum``.
37+
/// ``BasicConstraints``.
3838
public static let basicConstraints: ASN1ObjectIdentifier = [2, 5, 29, 19]
3939

4040
/// Identifies the name constraints extension, corresponding to
41-
/// ``Certificate/Extensions-swift.struct/NameConstraints-swift.struct``.
41+
/// ``NameConstraints``.
4242
public static let nameConstraints: ASN1ObjectIdentifier = [2, 5, 29, 30]
4343

4444
/// Identifies the extended key usage extension, corresponding to
45-
/// ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``.
45+
/// ``ExtendedKeyUsage``.
4646
public static let extendedKeyUsage: ASN1ObjectIdentifier = [2, 5, 29, 37]
4747

4848
/// Identifies the authority information access extension, corresponding to
49-
/// ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct``.
49+
/// ``AuthorityInformationAccess``.
5050
public static let authorityInformationAccess: ASN1ObjectIdentifier = [1, 3, 6, 1, 5, 5, 7, 1, 1]
5151
}
5252
}

Sources/X509/Extension Types/KeyUsage.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public struct KeyUsage {
2525
@usableFromInline
2626
internal var rawValue: UInt16
2727

28-
/// Construct a ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct`` extension with no usages set.
28+
/// Construct a ``KeyUsage`` extension with no usages set.
2929
@inlinable
3030
public init() {
3131
self.rawValue = 0
3232
}
3333

34-
/// Construct a ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct`` extension with some usages set.
34+
/// Construct a ``KeyUsage`` extension with some usages set.
3535
///
3636
/// - Parameters:
3737
/// - digitalSignature: This is true when the subject public key is used for verifying digital signatures,
@@ -80,7 +80,7 @@ public struct KeyUsage {
8080
self.decipherOnly = decipherOnly
8181
}
8282

83-
/// Create a new ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct`` object
83+
/// Create a new ``KeyUsage`` object
8484
/// by unwrapping a ``Certificate/Extension``.
8585
///
8686
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension Types/NameConstraints.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SwiftASN1
1717
/// Constraints the namespace within which all subject names issued by a given CA must reside.
1818
///
1919
/// These constraints apply both to the ``Certificate/subject`` and also to any
20-
/// ``SubjectAlternativeNames-swift.struct`` that may be present. Restrictions are applied to
20+
/// ``SubjectAlternativeNames`` that may be present. Restrictions are applied to
2121
/// specific name _forms_, and when the form is not present then the restriction does not apply.
2222
///
2323
/// Restrictions are defined in terms of both permitted and forbidden subtrees. The forbidden trees
@@ -263,7 +263,7 @@ public struct NameConstraints {
263263
self.excludedSubtrees = excludedSubtrees
264264
}
265265

266-
/// Create a new ``Certificate/Extensions-swift.struct/NameConstraints-swift.struct`` object
266+
/// Create a new ``NameConstraints`` object
267267
/// by unwrapping a ``Certificate/Extension``.
268268
///
269269
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension Types/SubjectAlternativeName.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public struct SubjectAlternativeNames {
3838
self.names = []
3939
}
4040

41-
/// Create a new ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct`` object
41+
/// Create a new ``SubjectAlternativeNames`` object
4242
/// by unwrapping a ``Certificate/Extension``.
4343
///
4444
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension Types/SubjectKeyIdentifier.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SwiftASN1
1717
/// Provides a means of identifying a certificate that contains a particular public key.
1818
///
1919
/// This extension contains a value derived from the public key of the certificate in which it appears.
20-
/// That value can be used to build the ``AuthorityKeyIdentifier-swift.struct/keyIdentifier`` field in
20+
/// That value can be used to build the ``AuthorityKeyIdentifier/keyIdentifier`` field in
2121
/// any certificate issued by this certificate. This makes it possible to identify a certificate
2222
/// possessing the key that issued another certificate.
2323
public struct SubjectKeyIdentifier {
@@ -31,7 +31,7 @@ public struct SubjectKeyIdentifier {
3131
self.keyIdentifier = keyIdentifier
3232
}
3333

34-
/// Create a new ``Certificate/Extensions-swift.struct/SubjectKeyIdentifier-swift.struct`` object
34+
/// Create a new ``SubjectKeyIdentifier`` object
3535
/// by unwrapping a ``Certificate/Extension``.
3636
///
3737
/// - Parameter ext: The ``Certificate/Extension`` to unwrap

Sources/X509/Extension.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ extension Certificate {
2424
/// it does not understand. A number of extensions have built-in support, and can be decoded directly from an ``Extension``
2525
/// value. These are:
2626
///
27-
/// - ``Certificate/Extensions-swift.struct/AuthorityInformationAccess-swift.struct``
28-
/// - ``Certificate/Extensions-swift.struct/AuthorityKeyIdentifier-swift.struct``
29-
/// - ``Certificate/Extensions-swift.struct/BasicConstraints-swift.enum``
30-
/// - ``Certificate/Extensions-swift.struct/ExtendedKeyUsage-swift.struct``
31-
/// - ``Certificate/Extensions-swift.struct/KeyUsage-swift.struct``
32-
/// - ``Certificate/Extensions-swift.struct/NameConstraints-swift.struct``
33-
/// - ``Certificate/Extensions-swift.struct/SubjectAlternativeNames-swift.struct``
34-
/// - ``Certificate/Extensions-swift.struct/SubjectKeyIdentifier-swift.struct``
27+
/// - ``AuthorityInformationAccess``
28+
/// - ``AuthorityKeyIdentifier``
29+
/// - ``BasicConstraints``
30+
/// - ``ExtendedKeyUsage``
31+
/// - ``KeyUsage``
32+
/// - ``NameConstraints``
33+
/// - ``SubjectAlternativeNames``
34+
/// - ``SubjectKeyIdentifier``
3535
///
3636
/// Users can write their own types by using a similar approach to these types, when it is necessary to add support for
3737
/// different X.509 extension.

0 commit comments

Comments
 (0)