diff --git a/Package.swift b/Package.swift index 5dcebac..3a86906 100644 --- a/Package.swift +++ b/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "didcomm-swift", platforms: [ .iOS(.v15), - .macOS(.v12), + .macOS(.v13), .macCatalyst(.v15), .tvOS(.v15), .watchOS(.v8) @@ -20,7 +20,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/swift-libp2p/swift-multibase.git", .upToNextMajor(from: "0.0.1")), - .package(url: "https://github.com/beatt83/didcore-swift.git", .upToNextMinor(from: "2.0.0")), + .package(url: "https://github.com/beatt83/didcore-swift.git", .upToNextMinor(from: "2.0.1")), .package(url: "https://github.com/beatt83/jose-swift.git", .upToNextMajor(from: "3.2.0")) ], targets: [ diff --git a/Sources/DIDCommSwift/Crypto/RecipientKeySelector.swift b/Sources/DIDCommSwift/Crypto/RecipientKeySelector.swift index 98a2c62..b822faa 100644 --- a/Sources/DIDCommSwift/Crypto/RecipientKeySelector.swift +++ b/Sources/DIDCommSwift/Crypto/RecipientKeySelector.swift @@ -36,7 +36,7 @@ struct RecipientKeySelector { let document = try await didResolver.resolve(did: didFrom.did) - guard let method = document.verificationMethods.first(where: { $0.id == signFrom }) else { + guard let method = document.verificationMethods?.first(where: { $0.id == signFrom }) else { throw DIDCommError.verificationMethodNotFoundForId(signFrom) } @@ -53,7 +53,7 @@ struct RecipientKeySelector { let document = try await didResolver.resolve(did: didFrom.did) - guard let method = document.verificationMethods.first(where: { $0.id == from }) else { + guard let method = document.verificationMethods?.first(where: { $0.id == from }) else { throw DIDCommError.verificationMethodNotFoundForId(from) } diff --git a/Sources/DIDCommSwift/Crypto/SenderKeySelector.swift b/Sources/DIDCommSwift/Crypto/SenderKeySelector.swift index 390440d..cfb1f12 100644 --- a/Sources/DIDCommSwift/Crypto/SenderKeySelector.swift +++ b/Sources/DIDCommSwift/Crypto/SenderKeySelector.swift @@ -107,7 +107,7 @@ struct SenderKeySelector { } let document = try await didResolver.resolve(did: didTo.did) if didTo.fragment != nil { - guard let verificationMethod = document.verificationMethods.first(where: { $0.id == to }) else { + guard let verificationMethod = document.verificationMethods?.first(where: { $0.id == to }) else { return [] } return [try KeyHelper.fromVerificationMethod(method: verificationMethod)] @@ -127,7 +127,7 @@ struct SenderKeySelector { } if didTo.fragment != nil { guard - let verificationMethod = document.verificationMethods.first(where: { $0.id == to }), + let verificationMethod = document.verificationMethods?.first(where: { $0.id == to }), let methodCurve = try? verificationMethod.getCurve(), curve == methodCurve else { @@ -150,7 +150,7 @@ extension DIDDocument { authentication?.map { switch $0 { case .stringValue(let value): - return verificationMethods.first { $0.id == value } + return verificationMethods?.first { $0.id == value } case .verificationMethod(let method): return method } @@ -161,7 +161,7 @@ extension DIDDocument { keyAgreement?.map { switch $0 { case .stringValue(let value): - return verificationMethods.first { $0.id == value } + return verificationMethods?.first { $0.id == value } case .verificationMethod(let method): return method }