Skip to content

Commit f25da1b

Browse files
committed
chore: update minimum versions
Upgrade minimum versions to the next one
1 parent 8d087c7 commit f25da1b

4 files changed

Lines changed: 13 additions & 126 deletions

File tree

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import PackageDescription
66
let package = Package(
77
name: "jose-swift",
88
platforms: [
9-
.iOS(.v14),
10-
.macOS(.v12),
11-
.macCatalyst(.v14),
12-
.tvOS(.v14),
13-
.watchOS(.v6)
9+
.iOS(.v15),
10+
.macOS(.v13),
11+
.macCatalyst(.v15),
12+
.tvOS(.v15),
13+
.watchOS(.v7)
1414
],
1515
products: [
1616
.library(

Sources/JSONWebAlgorithms/KeyManagement/KeyEncryption/AES/AESKeyUnwrap+KeyUnwrap.swift

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,9 @@ struct AESKeyUnwrap: KeyUnwrapping {
3737
guard let key = using.key else {
3838
throw CryptoError.missingOctetSequenceKey
3939
}
40-
if #available(iOS 15.0, macOS 12.0, watchOS 8.0, tvOS 15.0, *) {
41-
return try AES.KeyWrap.unwrap(
42-
encryptedKey,
43-
using: .init(data: key)
44-
).withUnsafeBytes { Data($0) }
45-
} else {
46-
#if canImport(Security)
47-
return try AESKeyWrapperCommonCrypto().unwrap(key: encryptedKey, encryptionKey: key)
48-
#else
49-
return try AES.KeyWrap.unwrap(
50-
encryptedKey,
51-
using: .init(data: key)
52-
).withUnsafeBytes { Data($0) }
53-
#endif
54-
}
40+
return try AES.KeyWrap.unwrap(
41+
encryptedKey,
42+
using: .init(data: key)
43+
).withUnsafeBytes { Data($0) }
5544
}
5645
}

Sources/JSONWebAlgorithms/KeyManagement/KeyEncryption/AES/AESKeyWrap+KeyEncryption.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,10 @@ struct AESKeyWrap: KeyWrapping {
4545
throw CryptoError.notValidPrivateKey
4646
}
4747

48-
let encryptedKey: Data
49-
if #available(iOS 15.0, macOS 12.0, watchOS 8.0, tvOS 15.0, *) {
50-
encryptedKey = try AES.KeyWrap.wrap(
51-
.init(data: cek),
52-
using: .init(data: key)
53-
)
54-
} else {
55-
#if canImport(Security)
56-
encryptedKey = try AESKeyWrapperCommonCrypto().wrap(key: cek, encryptionKey: key)
57-
#else
58-
encryptedKey = try AES.KeyWrap.wrap(
59-
.init(data: cek),
60-
using: .init(data: key)
61-
)
62-
#endif
63-
}
48+
let encryptedKey: Data = try AES.KeyWrap.wrap(
49+
.init(data: cek),
50+
using: .init(data: key)
51+
)
6452

6553
return .init(
6654
encryptedKey: encryptedKey,

Sources/JSONWebAlgorithms/KeyManagement/KeyEncryption/AES/AESKeyWrapCommonCrypto.swift

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)