feat: add crate swift-rs

This commit is contained in:
2023-12-09 10:17:41 +08:00
parent d36c06f461
commit 215b75d6da
35 changed files with 2489 additions and 2 deletions

View File

@@ -12,14 +12,18 @@ func isSupportSecureEnclave() -> Bool {
return SecureEnclave.isAvailable
}
@_cdecl("print_greeting")
func printGreeting(modifier: UnsafePointer<CChar>) {
print("Hello \(String(cString: modifier))World!")
}
enum StringError: Error {
case base64error
}
func generateKeyPair() throws {
var error: Unmanaged<CFError>? = nil;
guard
let accessCtrl = SecAccessControlCreateWithFlags(
guard let accessCtrl = SecAccessControlCreateWithFlags(
nil,
kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
[.privateKeyUsage, .biometryCurrentSet],