-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from niscy-eudiw/main
Enhance DocClaimsDecodable and related structures: update documentation, add docDataFormat property
- Loading branch information
Showing
10 changed files
with
447 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Sources/MdocDataModel18013/DocumentClaims/DocDataFormat.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Foundation | ||
/// Format of document data | ||
/// ``cbor``: IssuerSigned struct cbor encoded | ||
/// ``sdjwt``: vc+sd-jwt encoded | ||
/// | ||
/// Raw value must be a 4-length string due to keychain requirements | ||
public enum DocDataFormat: String, Sendable, CustomStringConvertible, CustomDebugStringConvertible, Codable { | ||
case cbor = "cbor" | ||
case sdjwt = "sjwt" | ||
|
||
/// A description to display | ||
public var description: String { | ||
switch self { | ||
case .cbor: return "mso_mdoc" | ||
case .sdjwt: return "vc+sd-jwt" | ||
} | ||
} | ||
|
||
public var debugDescription: String { | ||
description | ||
} | ||
} |
Oops, something went wrong.