Skip to content

Commit 8be8665

Browse files
committed
Update README.md
1 parent b8b628c commit 8be8665

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ if case let .persistentReference(data) = try keychain.store(
172172

173173
#### CryptoKit
174174

175-
`SwiftSecurity` lets you natively store `CryptoKit` keys as native `SecKey` instances. [Keys supporting such conversion](https://developer.apple.com/documentation/cryptokit/storing_cryptokit_keys_in_the_keychain), like `P256`/`P384`/`P521`, conform to `SecKeyConvertible` protocol.
175+
`SwiftSecurity` lets you natively store `CryptoKit` keys as native `SecKey` instances. [Keys supporting such conversion](https://developer.apple.com/documentation/cryptokit/storing_cryptokit_keys_in_the_keychain#3369556), like `P256`/`P384`/`P521`, conform to `SecKeyConvertible` protocol.
176176

177177
```swift
178178
// Store private key
@@ -190,7 +190,7 @@ try keychain.store(
190190
)
191191
```
192192

193-
Other key types from `CryptoKit`, like `SymmetricKey`, `Curve25519`, `SecureEnclave.P256`, have no direct keychain corollary. In particular, `SecureEnclave.P256` is a persistent reference to the key inside `Secure Enclave`, not the key itself. These keys conform to `SecDataConvertible`, so store them as follows:
193+
Other key types, like `SymmetricKey`, `Curve25519`, `SecureEnclave.P256`, have no direct keychain corollary. In particular, `SecureEnclave.P256` is a reference to the key inside `Secure Enclave`, not the key itself. These types conform to `SecDataConvertible`, so store them as follows:
194194

195195
```swift
196196
// Store symmetric key
@@ -199,7 +199,7 @@ try keychain.store(symmetricKey, query: .credential(for: "Chat"))
199199
```
200200

201201
> [!NOTE]
202-
> `SecKey` is intended for asymmetric key storage. Only `ECPrimeRandom` (`CryptoKit -> P256/384/512`) and `RSA` algorithms are supported. See [On Cryptographic Key Formats](https://developer.apple.com/forums/thread/680554) for more info.
202+
> `SecKey` is intended for asymmetric key storage, supporting only `ECSECPrimeRandom` (`CryptoKit -> P256/384/512`) and `RSA` algorithms. For details, see [On Cryptographic Key Formats](https://developer.apple.com/forums/thread/680554).
203203
204204
#### Certificate
205205

@@ -214,7 +214,7 @@ try certificate = Certificate(derRepresentation: certificateData)
214214
try keychain.store(certificate, query: .certificate(for: "Root CA"))
215215
```
216216

217-
If your project uses [apple/swift-certificates](https://github.com/apple/swift-certificates) package, the `Certificate` will offer more functionality. In case of `Swift Package Manager` dependency resolve issues, copy `SecCertificateConvertible` conformance directly to your project.
217+
You could use `SwiftSecurity` simultaneously with `X509` package from [apple/swift-certificates](https://github.com/apple/swift-certificates). In case of `Swift Package Manager` dependency resolve issues, copy `SecCertificateConvertible` conformance directly to your project.
218218

219219
#### Digital Identity
220220

@@ -399,7 +399,7 @@ To add support for custom types, you can extend them by conforming to the follow
399399
// Store as Data (GenericPassword, InternetPassword)
400400
extension CustomType: SecDataConvertible {}
401401

402-
// Store as Key (ANSI x9.63, Elliptic Curves)
402+
// Store as Key (ANSI x9.63 Elliptic Curves or RSA Keys)
403403
extension CustomType: SecKeyConvertible {}
404404

405405
// Store as Certificate (X.509)

0 commit comments

Comments
 (0)