Skip to content

Commit 9f35a98

Browse files
authored
Added WatchOS package platform (airsidemobile#264)
1 parent 90ff639 commit 9f35a98

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

JOSESwift/Sources/CryptoImplementation/EC.swift

+4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
import Foundation
2525
import Security
2626
import CommonCrypto
27+
#if canImport(LocalAuthentication)
2728
import LocalAuthentication
29+
#endif
2830

2931
internal enum ECError: Error {
3032
case algorithmNotSupported
@@ -161,9 +163,11 @@ internal struct EC {
161163
let errorDomain = CFErrorGetDomain(cfError)
162164
let errorCode = CFErrorGetCode(cfError)
163165

166+
#if canImport(LocalAuthentication)
164167
if errorDomain == LAErrorDomain as CFErrorDomain {
165168
throw ECError.localAuthenticationFailed(errorCode: errorCode)
166169
}
170+
#endif
167171
throw ECError.signingFailed(description: "Error creating signature. (CFError: \(cfError))")
168172
}
169173
fatalError("SecKeyCreateSignature returned nil but did not set CFError object.")

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PackageDescription
33

44
let package = Package(
55
name: "JOSESwift",
6-
platforms: [.iOS(.v10), .macOS(.v10_15)],
6+
platforms: [.iOS(.v10), .macOS(.v10_15), .watchOS(.v4)],
77
products: [
88
.library(name: "JOSESwift", targets: ["JOSESwift"])
99
],

0 commit comments

Comments
 (0)