From b632d5f8a8608e644612e75d9fb5aeb772c76dc9 Mon Sep 17 00:00:00 2001 From: "Josep Milan K.A" Date: Tue, 3 Sep 2024 17:11:41 +0530 Subject: [PATCH] Fix: Added function to return credential display by providing the type and issuer config --- Sources/eudiWalletOidcIos/Service/IssueService.swift | 10 ++++++++++ .../Service/IssueServiceProtocol.swift | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Sources/eudiWalletOidcIos/Service/IssueService.swift b/Sources/eudiWalletOidcIos/Service/IssueService.swift index 8efc2b3..b402317 100644 --- a/Sources/eudiWalletOidcIos/Service/IssueService.swift +++ b/Sources/eudiWalletOidcIos/Service/IssueService.swift @@ -628,6 +628,16 @@ public class IssueService: NSObject, IssueServiceProtocol { return nil } } + + public func getCredentialDisplayFromIssuerConfig(issuerConfig: IssuerWellKnownConfiguration?, type: String?) -> Display? { + guard let issuerConfig = issuerConfig else { return nil } + + if let credentialSupported = issuerConfig.credentialsSupported?.dataSharing?[type ?? ""] { + return credentialSupported.display?[0] ?? nil + } else { + return nil + } + } } diff --git a/Sources/eudiWalletOidcIos/Service/IssueServiceProtocol.swift b/Sources/eudiWalletOidcIos/Service/IssueServiceProtocol.swift index bc1dee8..d7c1bbb 100644 --- a/Sources/eudiWalletOidcIos/Service/IssueServiceProtocol.swift +++ b/Sources/eudiWalletOidcIos/Service/IssueServiceProtocol.swift @@ -76,4 +76,6 @@ protocol IssueServiceProtocol { func getCryptoFromIssuerConfig(issuerConfig: IssuerWellKnownConfiguration?, type: String?) -> [String]? + func etCredentialDisplayFromIssuerConfig(issuerConfig: IssuerWellKnownConfiguration?, type: String?) -> Display? + }