SwiftBindings.Apple.CryptoKit
26.2.15
dotnet add package SwiftBindings.Apple.CryptoKit --version 26.2.15
NuGet\Install-Package SwiftBindings.Apple.CryptoKit -Version 26.2.15
<PackageReference Include="SwiftBindings.Apple.CryptoKit" Version="26.2.15" />
<PackageVersion Include="SwiftBindings.Apple.CryptoKit" Version="26.2.15" />
<PackageReference Include="SwiftBindings.Apple.CryptoKit" />
paket add SwiftBindings.Apple.CryptoKit --version 26.2.15
#r "nuget: SwiftBindings.Apple.CryptoKit, 26.2.15"
#:package SwiftBindings.Apple.CryptoKit@26.2.15
#addin nuget:?package=SwiftBindings.Apple.CryptoKit&version=26.2.15
#tool nuget:?package=SwiftBindings.Apple.CryptoKit&version=26.2.15
SwiftBindings.Apple.CryptoKit
Native .NET bindings for Apple's CryptoKit framework — hashing, symmetric and authenticated encryption, key agreement, and signatures. These are not Objective-C proxy wrappers; they use .NET 10's native Swift interop for direct, high-performance calls into Swift APIs from C#.
📖 Full usage guide → — Swift→C# naming, authenticated encryption (AES-GCM/ChaChaPoly), hashing, HMAC, key agreement, ECDSA signatures, and the generic-overload caveats that decide which APIs are callable.
Installation
dotnet add package SwiftBindings.Apple.CryptoKit
Requirements
- .NET 10.0+
- Target framework:
net10.0-ios26.2(or-macos26.2/-maccatalyst26.2/-tvos26.2) or higher. The package is compiled against the iOS 26.2 SDK supplement, so your app's<TargetFramework>platform version must be ≥ 26.2 to restore it — an explicit lower TPV (e.g.net10.0-ios18.0) or a barenet10.0-ioswhose installed workload defaults below 26.2 fails restore withNU1202. This is the compile-SDK pin, not your app's deployment minimum. - Deployment minimum is separate — set your app's real minimum OS with
<SupportedOSPlatformVersion>(independent of the TFM above). Individual APIs that need a newer OS at runtime are gated by generated[SupportedOSPlatform]attributes; the C# compiler flags a call that isn't valid for your target. - macOS host for development
Usage
Hashing
using System.Text;
using CryptoKit;
var data = Encoding.UTF8.GetBytes("hello");
var digest = SHA256.Hash(data);
Authenticated encryption (AES-GCM)
using System.Text;
using CryptoKit;
var key = new SymmetricKey(SymmetricKeySize.Bits256);
var plaintext = Encoding.UTF8.GetBytes("secret message");
var sealedBox = AES.GCM.Seal(plaintext, key);
var recovered = AES.GCM.Open(sealedBox, key);
ChaChaPoly
var key = new SymmetricKey(SymmetricKeySize.Bits256);
var sealedBox = ChaChaPoly.Seal(plaintext, key);
var recovered = ChaChaPoly.Open(sealedBox, key);
Authenticated encryption with associated data
var aad = Encoding.UTF8.GetBytes("authenticated-header");
var sealedBox = AES.GCM.Seal(plaintext, key, aad);
// sealedBox.Ciphertext / sealedBox.Tag are exposed as byte[]
Documentation
- Usage guide (wiki) — full C# walkthrough of the binding surface
- Apple CryptoKit framework
Caveats
The primary AEAD round-trip (AES.GCM and ChaChaPoly Seal/Open) is verified end-to-end on both Mono JIT (simulator) and NativeAOT (device).
A residual cluster of ancillary CryptoKit APIs are emitted as [Obsolete("SB0001")] stubs and are not callable from C# in this release:
- HMAC constructor
- Signature generation (P-256/P-384/P-521 ECDSA
signature(for:)) - HPKE
Unwrap/Decapsulate/ExportSecret AES.GCM.Open<TAD>(the generic overload that takes authenticated-data of an arbitraryDataProtocoltype)- The 3-argument
IsValidSignature(_:for:)overload
Tamper detection is exercised via wrong-key Open (which throws authenticationFailure) rather than the SealedBox(nonce:ciphertext:tag:) constructor (a Swift generic init the binding generator does not yet emit).
How It Works
These bindings are auto-generated by Swift Dotnet Bindings using .NET 10's native Swift interop via the SwiftBindings SDK.
License
The bindings are MIT licensed. CryptoKit is part of the Apple SDK; refer to Apple's licensing for the underlying framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-ios26.2 is compatible. net10.0-maccatalyst26.2 is compatible. net10.0-macos26.2 is compatible. net10.0-tvos26.2 is compatible. |
-
net10.0-ios26.2
- SwiftBindings.Apple (>= 26.2.9)
- SwiftBindings.Runtime (>= 0.20.0 && < 0.21.0)
-
net10.0-maccatalyst26.2
- SwiftBindings.Apple (>= 26.2.9)
- SwiftBindings.Runtime (>= 0.20.0 && < 0.21.0)
-
net10.0-macos26.2
- SwiftBindings.Apple (>= 26.2.9)
- SwiftBindings.Runtime (>= 0.20.0 && < 0.21.0)
-
net10.0-tvos26.2
- SwiftBindings.Apple (>= 26.2.9)
- SwiftBindings.Runtime (>= 0.20.0 && < 0.21.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 26.2.15 | 59 | 9/22/2026 |
| 26.2.14 | 116 | 9/5/2026 |
| 26.2.13 | 104 | 9/2/2026 |
| 26.2.12 | 111 | 8/29/2026 |
| 26.2.11 | 118 | 8/24/2026 |
| 26.2.10 | 127 | 8/5/2026 |
| 26.2.9 | 119 | 7/31/2026 |
| 26.2.8 | 133 | 6/27/2026 |
| 26.2.7 | 130 | 6/15/2026 |
| 26.2.6 | 137 | 6/11/2026 |
| 26.2.5 | 133 | 6/1/2026 |
| 26.2.3 | 122 | 5/19/2026 |
| 26.2.1 | 129 | 5/3/2026 |