diff --git a/Sources/JWSETKit/Cryptography/RSA/JWK-RSA.swift b/Sources/JWSETKit/Cryptography/RSA/JWK-RSA.swift index 870bc17..95b7fb7 100644 --- a/Sources/JWSETKit/Cryptography/RSA/JWK-RSA.swift +++ b/Sources/JWSETKit/Cryptography/RSA/JWK-RSA.swift @@ -116,14 +116,14 @@ public struct JSONWebRSAPrivateKey: MutableJSONWebKey, JSONWebSigningKey, JSONWe } public init(algorithm _: any JSONWebAlgorithm) throws { - try self.init(bitCount: .bits2048) + try self.init(keySize: .bits2048) } - public init(bitCount: KeySize) throws { + public init(keySize: KeySize) throws { #if canImport(CommonCrypto) - self.storage = try SecKey(rsaBitCounts: bitCount.bitCount).storage + self.storage = try SecKey(rsaBitCounts: keySize.bitCount).storage #elseif canImport(_CryptoExtras) - self.storage = try _RSA.Signing.PrivateKey(keySize: .init(bitCount: bitCount)).storage + self.storage = try _RSA.Signing.PrivateKey(keySize: .init(bitCount: keySize.bitCount)).storage #else // This should never happen as CommonCrypto is available on Darwin platforms // and CryptoExtras is used on non-Darwin platform. diff --git a/Tests/JWSETKitTests/Cryptography/RSATests.swift b/Tests/JWSETKitTests/Cryptography/RSATests.swift index 93b5d3a..a1391c8 100644 --- a/Tests/JWSETKitTests/Cryptography/RSATests.swift +++ b/Tests/JWSETKitTests/Cryptography/RSATests.swift @@ -179,7 +179,7 @@ final class RSATests: XCTestCase { } func testSigning_RSA3072_PSS_SHA256() throws { - let privateKey = try JSONWebRSAPrivateKey(bitCount: .bits3072) + let privateKey = try JSONWebRSAPrivateKey(keySize: .bits3072) let publicKey = privateKey.publicKey let signature = try privateKey.signature(plaintext, using: .rsaSignaturePSSSHA256) @@ -190,7 +190,7 @@ final class RSATests: XCTestCase { } func testSigning_RSA4096_PSS_SHA256() throws { - let privateKey = try JSONWebRSAPrivateKey(bitCount: .bits4096) + let privateKey = try JSONWebRSAPrivateKey(keySize: .bits4096) let publicKey = privateKey.publicKey let signature = try privateKey.signature(plaintext, using: .rsaSignaturePSSSHA256)