Skip to content

Commit 5b1f52d

Browse files
committed
CryptoKit docs
1 parent c2aa3e7 commit 5b1f52d

File tree

5 files changed

+89
-40
lines changed

5 files changed

+89
-40
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cryptography-kotlin provides multiplatform API which consists of multiple compon
2222
like [ciphers][ciphers], [digests][digests], [signatures][signatures], [key derivation][key derivation], [Key agreement][Key agreement]
2323
* multiple algorithms definitions, like [AES][AES], [RSA][RSA], [ECDSA][ECDSA], [ECDH][ECDH], [SHA][SHA256], [HMAC][HMAC]
2424
and [PBKDF2][PBKDF2]
25-
* multiple cryptography [providers][providers], like [OpenSSL][OpenSSL], [WebCrypto][WebCrypto] and [JDK][JDK]
25+
* multiple cryptography [providers][providers], like [OpenSSL][OpenSSL], [WebCrypto][WebCrypto], [CryptoKit][CryptoKit] and [JDK][JDK]
2626

2727
The library doesn't implement any cryptography algorithm on its own, but wraps well-known future-proof solutions
2828
like [OpenSSL 3.x](https://www.openssl.org), [WebCrypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)
@@ -132,6 +132,8 @@ For bugs, questions and discussions, please use the [GitHub Issues](https://gith
132132

133133
[WebCrypto]: https://whyoleg.github.io/cryptography-kotlin/modules/cryptography-provider-webcrypto/
134134

135+
[CryptoKit]: https://developer.apple.com/documentation/cryptokit/
136+
135137
[JDK]: https://whyoleg.github.io/cryptography-kotlin/modules/cryptography-provider-jdk/
136138

137139
[BOM]: https://whyoleg.github.io/cryptography-kotlin/bom/

build-logic/src/main/kotlin/ckbuild/artifacts.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright (c) 2023-2025 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package ckbuild
@@ -16,6 +16,7 @@ val artifacts
1616
"cryptography-provider-base",
1717
"cryptography-provider-jdk",
1818
"cryptography-provider-apple",
19+
"cryptography-provider-cryptokit",
1920
"cryptography-provider-webcrypto",
2021
"cryptography-provider-openssl3-api",
2122
"cryptography-provider-openssl3-shared",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Module cryptography-provider-cryptokit
2+
3+
Provides implementation of [CryptographyProvider][CryptographyProvider] via [CryptoKit][CryptoKit]
4+
5+
For supported targets and algorithms, please consult [Supported primitives section][Supported primitives section]
6+
7+
## Limitations
8+
9+
* KeyFormat: doesn't support `JWK` key format yet
10+
* AES.GCM supports only a default tag size of 96 bits
11+
12+
## Example
13+
14+
```kotlin
15+
val provider = CryptographyProvider.CryptoKit // or CryptographyProvider.Default
16+
17+
// get some algorithm
18+
provider.get(SHA512)
19+
```
20+
21+
## Using in your projects
22+
23+
```kotlin
24+
dependencies {
25+
implementation("dev.whyoleg.cryptography:cryptography-provider-cryptokit:0.4.0")
26+
}
27+
```
28+
29+
[CryptographyProvider]: https://whyoleg.github.io/cryptography-kotlin/api/cryptography-core/dev.whyoleg.cryptography/-cryptography-provider/index.html
30+
31+
[CryptoKit]: https://developer.apple.com/documentation/cryptokit/
32+
33+
[Supported primitives section]: https://whyoleg.github.io/cryptography-kotlin/providers#supported-primitives
34+
35+
# Package dev.whyoleg.cryptography.providers.cryptokit
36+
37+
Provides implementation of [CryptographyProvider][CryptographyProvider] via [CryptoKit][CryptoKit]
38+
39+
[CryptographyProvider]: https://whyoleg.github.io/cryptography-kotlin/api/cryptography-core/dev.whyoleg.cryptography/-cryptography-provider/index.html
40+
41+
[CryptoKit]: https://developer.apple.com/documentation/cryptokit/
42+
43+
[Supported primitives section]: https://whyoleg.github.io/cryptography-kotlin/providers#supported-primitives

docs/providers/index.md

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ On current moment following providers are available out of the box:
88
[WebCrypto](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API)
99
* [Apple](../modules/cryptography-provider-apple.md) - via
1010
[CommonCrypto](https://developer.apple.com/library/archive/documentation/Security/Conceptual/cryptoservices/Introduction/Introduction.html)
11+
* [CryptoKit](../modules/cryptography-provider-cryptokit.md) - via
12+
[CryptoKit](https://developer.apple.com/documentation/cryptokit/)
1113
* [OpenSSL3](../modules/cryptography-provider-openssl3.md) - via [OpenSSL 3.x](https://www.openssl.org),
1214
statically linked to prebuilt OpenSSL 3.3.2 or dynamically linked (experimental)
1315

@@ -23,19 +25,19 @@ For additional limitation please consult provider specific documentation.
2325

2426
### Supported targets per provider
2527

26-
| Target | jdk | webcrypto | apple | openssl3 |
27-
|-----------------------------------------------------------------------------------------------|-----|-----------|-------|-----------------|
28-
| jvm |||||
29-
| js |||||
30-
| wasmJs |||||
31-
| wasmWasi |||||
32-
| iosX64<br/>iosSimulatorArm64<br/>iosArm64 |||| ✅ prebuilt only |
33-
| watchosX64<br/>watchosArm32<br/>watchosArm64<br/>watchosSimulatorArm64<br/>watchosDeviceArm64 |||| ✅ prebuilt only |
34-
| tvosX64<br/>tvosArm64<br/>tvosSimulatorArm64 |||| ✅ prebuilt only |
35-
| macosX64<br/>macosArm64 |||||
36-
| linuxX64<br/>linuxArm64 |||||
37-
| mingwX64 |||||
38-
| androidNativeX64<br/>androidNativeX86<br/>androidNativeArm64<br/>androidNativeArm32 |||| ✅ prebuilt only |
28+
| Target | jdk | webcrypto | apple | cryptokit | openssl3 |
29+
|-----------------------------------------------------------------------------------------------|-----|-----------|-------|---------------------------|-----------------|
30+
| jvm |||| | |
31+
| js |||| | |
32+
| wasmJs |||| | |
33+
| wasmWasi |||| | |
34+
| iosX64<br/>iosSimulatorArm64<br/>iosArm64 |||| |prebuilt only |
35+
| watchosX64<br/>watchosArm32<br/>watchosArm64<br/>watchosSimulatorArm64<br/>watchosDeviceArm64 ||||(except `watchosArm32`) |prebuilt only |
36+
| tvosX64<br/>tvosArm64<br/>tvosSimulatorArm64 |||| |prebuilt only |
37+
| macosX64<br/>macosArm64 |||| ||
38+
| linuxX64<br/>linuxArm64 |||| | |
39+
| mingwX64 |||| | |
40+
| androidNativeX64<br/>androidNativeX86<br/>androidNativeArm64<br/>androidNativeArm32 |||| | ✅ prebuilt only |
3941

4042
> ✅ : supported
4143
>
@@ -48,31 +50,31 @@ For additional limitation please consult provider specific documentation.
4850
> `supported` here means that those algorithms are tested and works at least in some configuration
4951
> (f.e. different Java versions or Java providers can have different algorithms supported)
5052
51-
| Operation | Algorithm | jdk | webcrypto | apple | openssl3 |
52-
|---------------------------------------------|------------------|:---:|:---------:|:-----:|:--------:|
53-
| **Digest** | ⚠️ MD5 |||||
54-
| | ⚠️ SHA1 |||||
55-
| | SHA224 |||||
56-
| | SHA256 |||||
57-
| | SHA384 |||||
58-
| | SHA512 |||||
59-
| | SHA3 family |||||
60-
| | ⚠️ RIPEMD160 |||||
61-
| **MAC** | HMAC |||||
62-
| | CMAC |||||
63-
| **Symmetric-key<br/>encryption/decryption** | AES-CBC |||||
64-
| | AES-CTR |||||
65-
| | AES-GCM |||||
66-
| | ⚠️ AES-ECB |||||
67-
| **Public-key<br/>encryption/decryption** | RSA-OAEP |||||
68-
| | ⚠️ RSA-PKS1-v1_5 |||||
69-
| | ⚠️ RSA-RAW |||||
70-
| **Digital Signatures** | ECDSA |||||
71-
| | RSA-SSA-PSS |||||
72-
| | RSA-PKS1-v1_5 |||||
73-
| **Key Agreement** | ECDH |||||
74-
| **PRF/KDF** | PBKDF2 |||||
75-
| | HKDF |||||
53+
| Operation | Algorithm | jdk | webcrypto | apple | cryptokit | openssl3 |
54+
|---------------------------------------------|------------------|:---:|:---------:|:-----:|-----------|:--------:|
55+
| **Digest** | ⚠️ MD5 |||| | |
56+
| | ⚠️ SHA1 |||| | |
57+
| | SHA224 |||| | |
58+
| | SHA256 |||| | |
59+
| | SHA384 |||| | |
60+
| | SHA512 |||| | |
61+
| | SHA3 family |||| | |
62+
| | ⚠️ RIPEMD160 |||| | |
63+
| **MAC** | HMAC |||| | |
64+
| | CMAC |||| | |
65+
| **Symmetric-key<br/>encryption/decryption** | AES-CBC |||| | |
66+
| | AES-CTR |||| | |
67+
| | AES-GCM |||| | |
68+
| | ⚠️ AES-ECB |||| | |
69+
| **Public-key<br/>encryption/decryption** | RSA-OAEP |||| | |
70+
| | ⚠️ RSA-PKS1-v1_5 |||| | |
71+
| | ⚠️ RSA-RAW |||| | |
72+
| **Digital Signatures** | ECDSA |||| | |
73+
| | RSA-SSA-PSS |||| | |
74+
| | RSA-PKS1-v1_5 |||| | |
75+
| **Key Agreement** | ECDH |||| | |
76+
| **PRF/KDF** | PBKDF2 |||| | |
77+
| | HKDF |||| | |
7678

7779
> ⚠️ : use carefully
7880
>

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ nav:
4141
- 'WebCrypto': modules/cryptography-provider-webcrypto.md
4242
- 'Apple': modules/cryptography-provider-apple.md
4343
- 'OpenSSL3': modules/cryptography-provider-openssl3.md
44+
- 'CryptoKit': modules/cryptography-provider-cryptokit.md
4445
- 'API': api/index.html
4546

4647
theme:

0 commit comments

Comments
 (0)