Skip to content

Commit

Permalink
Add list all credential claims possibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliano1612 committed Oct 16, 2024
1 parent 6ce57e9 commit 08da72d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Sources/MobileSdk/CredentialPack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,23 @@ public class CredentialPack {
.map { credential in
var claims: [String: GenericJSON]
if let mdoc = credential.asMsoMdoc() {
claims = mdoc.jsonEncodedDetails(containing: claimNames)
if claimNames.isEmpty {
claims = mdoc.jsonEncodedDetails()
} else {
claims = mdoc.jsonEncodedDetails(containing: claimNames)
}
} else if let jwtVc = credential.asJwtVc() {
claims = jwtVc.credentialClaims(containing: claimNames)
if claimNames.isEmpty {
claims = jwtVc.credentialClaims()
} else {
claims = jwtVc.credentialClaims(containing: claimNames)
}
} else if let jsonVc = credential.asJsonVc() {
claims = jsonVc.credentialClaims(containing: claimNames)
if claimNames.isEmpty {
claims = jsonVc.credentialClaims()
} else {
claims = jsonVc.credentialClaims(containing: claimNames)
}
} else {
var type: String
do {
Expand Down

0 comments on commit 08da72d

Please sign in to comment.