You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bridge between Certificate and Security.SecCertificate (#182)
* Add bridge between Certificate and Security.SecCertificate
* Add documentation for explaining the bridge between `Certificate` and `Security.SecCertificate`. Add `make` prefix to `SecCertificate` factory method.
Copy file name to clipboardExpand all lines: Sources/X509/Certificate.swift
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,11 @@ import SwiftASN1
58
58
/// across the rest of the data. Allowing users to change this data makes it easy to accidentally modify
59
59
/// a ``Certificate`` in one part of your code and not realise that the signature has inevitably
60
60
/// been invalidated.
61
+
///
62
+
/// ### Creating Certificates from SecCertificate and vice versa
63
+
///
64
+
/// An instance of ``Certificate`` can be created from ``Security/SecCertificate`` (from the ``Security`` framework) with ``Certificate/init(_:)``.
65
+
/// The opposite, that is, creating an instance of ``Security/SecCertificate`` from ``Certificate``, can be achieved with ``Security/SecCertificate/makeWithCertificate(_:)``.
let derEncodedCertificate = serializer.serializedBytes
179
179
let derEncodedPrivateKey = swiftCryptoKey.derRepresentation
180
180
```
181
+
182
+
### Creating Certificates from SecCertificate and vice versa
183
+
184
+
An instance of ``Certificate`` can be created from ``Security/SecCertificate`` (from the ``Security`` framework) with ``Certificate/init(_:)``.
185
+
The opposite, that is, creating an instance of ``Security/SecCertificate`` from ``Certificate``, can be achieved with ``Security/SecCertificate/makeWithCertificate(_:)``.
0 commit comments