diff --git a/Documentation/Reference/README.md b/Documentation/Reference/README.md index 28392454..eb4d29b7 100644 --- a/Documentation/Reference/README.md +++ b/Documentation/Reference/README.md @@ -8,6 +8,7 @@ ## Structs +- [ConferenceBadgeModel](structs/ConferenceBadgeModel.md) - [ConnectionMethodHttp](structs/ConnectionMethodHttp.md) - [Cose](structs/Cose.md) - [CoseKey](structs/CoseKey.md) @@ -38,6 +39,7 @@ - [IssuerSignedItem](structs/IssuerSignedItem.md) - [ItemsRequest](structs/ItemsRequest.md) - [MobileSecurityObject](structs/MobileSecurityObject.md) +- [NameImage](structs/NameImage.md) - [NameValue](structs/NameValue.md) - [OriginInfoWebsite](structs/OriginInfoWebsite.md) - [RequestDataElements](structs/RequestDataElements.md) @@ -55,6 +57,7 @@ ## Enums +- [ConferenceBadgeModel.CodingKeys](enums/ConferenceBadgeModel.CodingKeys.md) - [Cose.CoseType](enums/Cose.CoseType.md) - [Cose.MacAlgorithm](enums/Cose.MacAlgorithm.md) - [Cose.VerifyAlgorithm](enums/Cose.VerifyAlgorithm.md) @@ -73,6 +76,7 @@ - [CBOR.Tag](extensions/CBOR.Tag.md) - [CBORDecodable](extensions/CBORDecodable.md) - [CBOREncodable](extensions/CBOREncodable.md) +- [ConferenceBadgeModel](extensions/ConferenceBadgeModel.md) - [ConnectionMethodHttp](extensions/ConnectionMethodHttp.md) - [Cose](extensions/Cose.md) - [CoseKey](extensions/CoseKey.md) @@ -87,6 +91,7 @@ - [DeviceRetrievalMethod](extensions/DeviceRetrievalMethod.md) - [DeviceSigned](extensions/DeviceSigned.md) - [DeviceSignedItems](extensions/DeviceSignedItems.md) +- [Dictionary](extensions/Dictionary.md) - [DigestIDs](extensions/DigestIDs.md) - [DocRequest](extensions/DocRequest.md) - [Document](extensions/Document.md) @@ -128,4 +133,4 @@ - [NameSpace](typealiases/NameSpace.md) - [UInt8.Byte](typealiases/UInt8.Byte.md) -This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2023-11-15 07:32:12 +0000 \ No newline at end of file +This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2023-12-11 08:50:42 +0000 \ No newline at end of file diff --git a/Documentation/Reference/enums/ConferenceBadgeModel.CodingKeys.md b/Documentation/Reference/enums/ConferenceBadgeModel.CodingKeys.md new file mode 100644 index 00000000..b177f93d --- /dev/null +++ b/Documentation/Reference/enums/ConferenceBadgeModel.CodingKeys.md @@ -0,0 +1,54 @@ +**ENUM** + +# `ConferenceBadgeModel.CodingKeys` + +**Contents** + +- [Cases](#cases) + - `family_name` + - `given_name` + - `expiry_date` + - `registration_id` + - `room_number` + - `seat_number` + +```swift +public enum CodingKeys: String, CodingKey, CaseIterable +``` + +## Cases +### `family_name` + +```swift +case family_name +``` + +### `given_name` + +```swift +case given_name +``` + +### `expiry_date` + +```swift +case expiry_date +``` + +### `registration_id` + +```swift +case registration_id +``` + +### `room_number` + +```swift +case room_number +``` + +### `seat_number` + +```swift +case seat_number +``` diff --git a/Documentation/Reference/enums/EuPidModel.CodingKeys.md b/Documentation/Reference/enums/EuPidModel.CodingKeys.md index 9b9abd51..59af4211 100644 --- a/Documentation/Reference/enums/EuPidModel.CodingKeys.md +++ b/Documentation/Reference/enums/EuPidModel.CodingKeys.md @@ -8,7 +8,6 @@ - `family_name` - `given_name` - `birth_date` - - `unique_id` - `family_name_birth` - `given_name_birth` - `birth_place` @@ -57,12 +56,6 @@ case given_name case birth_date ``` -### `unique_id` - -```swift -case unique_id -``` - ### `family_name_birth` ```swift diff --git a/Documentation/Reference/extensions/Array.md b/Documentation/Reference/extensions/Array.md index 06419e75..82d5c5e2 100644 --- a/Documentation/Reference/extensions/Array.md +++ b/Documentation/Reference/extensions/Array.md @@ -54,3 +54,9 @@ public func findMap(name: String) -> [CBOR:CBOR]? ```swift public func findArray(name: String) -> [CBOR]? ``` + +### `toJson()` + +```swift +public func toJson() -> [String: Any] +``` diff --git a/Documentation/Reference/extensions/CBOR.md b/Documentation/Reference/extensions/CBOR.md index 9082ab34..0d48e53f 100644 --- a/Documentation/Reference/extensions/CBOR.md +++ b/Documentation/Reference/extensions/CBOR.md @@ -88,6 +88,12 @@ public func asBytes() -> [UInt8]? public func asData() -> Data ``` +### `asDateString(_:_:)` + +```swift +public static func asDateString(_ tag: Tag, _ value: CBOR) -> Any +``` + ### `asCose()` ```swift @@ -100,14 +106,14 @@ public func asCose() -> (CBOR.Tag, [CBOR])? public func decodeBytestring() -> CBOR? ``` -### `decodeList(_:unwrap:)` +### `decodeList(_:unwrap:base64:)` ```swift -public static func decodeList(_ list: [CBOR], unwrap: Bool = true) -> [Any] +public static func decodeList(_ list: [CBOR], unwrap: Bool = true, base64: Bool = false) -> [Any] ``` -### `decodeDictionary(_:unwrap:)` +### `decodeDictionary(_:unwrap:base64:)` ```swift -public static func decodeDictionary(_ dictionary: [CBOR:CBOR], unwrap: Bool = true) -> [String: Any] +public static func decodeDictionary(_ dictionary: [CBOR:CBOR], unwrap: Bool = true, base64: Bool = false) -> [String: Any] ``` diff --git a/Documentation/Reference/extensions/ConferenceBadgeModel.md b/Documentation/Reference/extensions/ConferenceBadgeModel.md new file mode 100644 index 00000000..bedabc36 --- /dev/null +++ b/Documentation/Reference/extensions/ConferenceBadgeModel.md @@ -0,0 +1,13 @@ +**EXTENSION** + +# `ConferenceBadgeModel` +```swift +extension ConferenceBadgeModel +``` + +## Methods +### `init(response:devicePrivateKey:)` + +```swift +public init?(response: DeviceResponse, devicePrivateKey: CoseKeyPrivate) +``` diff --git a/Documentation/Reference/extensions/CoseKeyPrivate.md b/Documentation/Reference/extensions/CoseKeyPrivate.md index f4952daf..a194b7fc 100644 --- a/Documentation/Reference/extensions/CoseKeyPrivate.md +++ b/Documentation/Reference/extensions/CoseKeyPrivate.md @@ -12,6 +12,18 @@ extension CoseKeyPrivate public init(crv: ECCurveType) ``` +### `init(privateKeyx963Data:crv:)` + +```swift +public init(privateKeyx963Data: Data, crv: ECCurveType = .p256) +``` + +### `init(publicKeyx963Data:secureEnclaveData:)` + +```swift +public init(publicKeyx963Data: Data, secureEnclaveData: Data) +``` + ### `init(base64:)` ```swift diff --git a/Documentation/Reference/extensions/Data.md b/Documentation/Reference/extensions/Data.md index 64572bb9..bfe6fa75 100644 --- a/Documentation/Reference/extensions/Data.md +++ b/Documentation/Reference/extensions/Data.md @@ -21,7 +21,7 @@ init from local file ### `decodeJSON(type:)` ```swift -public func decodeJSON(type: T.Type) -> T? +public func decodeJSON(type: T.Type = T.self) -> T? ``` ### `init(base64URLEncoded:options:)` diff --git a/Documentation/Reference/extensions/Dictionary.md b/Documentation/Reference/extensions/Dictionary.md new file mode 100644 index 00000000..3413c87d --- /dev/null +++ b/Documentation/Reference/extensions/Dictionary.md @@ -0,0 +1,13 @@ +**EXTENSION** + +# `Dictionary` +```swift +extension Dictionary where Key == String, Value == Any +``` + +## Methods +### `decodeJSON(type:)` + +```swift +public func decodeJSON(type: T.Type = T.self) -> T? +``` diff --git a/Documentation/Reference/extensions/MdocDecodable.md b/Documentation/Reference/extensions/MdocDecodable.md index 4e2bd625..b424f4e6 100644 --- a/Documentation/Reference/extensions/MdocDecodable.md +++ b/Documentation/Reference/extensions/MdocDecodable.md @@ -18,20 +18,20 @@ public func getItemValue(_ s: String) -> T? public static func getSignedItems(_ response: DeviceResponse, _ docType: String, _ ns: [NameSpace]? = nil) -> [String: [IssuerSignedItem]]? ``` -### `extractAgeOverValues(_:_:)` +### `toJson()` ```swift -public static func extractAgeOverValues(_ nameSpaces: [NameSpace: [IssuerSignedItem]], _ ageOverXX: inout [Int: Bool]) +public func toJson() -> [String: Any] ``` -### `moreThan2AgeOverElementIdentifiers(_:_:_:_:)` +### `extractAgeOverValues(_:_:)` ```swift -public static func moreThan2AgeOverElementIdentifiers(_ reqDocType: DocType, _ reqNamespace: NameSpace, _ ageAttest: any AgeAttesting, _ reqElementIdentifiers: [DataElementIdentifier]) -> Set +public static func extractAgeOverValues(_ nameSpaces: [NameSpace: [IssuerSignedItem]], _ ageOverXX: inout [Int: Bool]) ``` -### `extractDisplayStrings(_:_:)` +### `moreThan2AgeOverElementIdentifiers(_:_:_:_:)` ```swift -public static func extractDisplayStrings(_ nameSpaces: [NameSpace: [IssuerSignedItem]], _ displayStrings: inout [NameValue]) +public static func moreThan2AgeOverElementIdentifiers(_ reqDocType: DocType, _ reqNamespace: NameSpace, _ ageAttest: any AgeAttesting, _ reqElementIdentifiers: [DataElementIdentifier]) -> Set ``` diff --git a/Documentation/Reference/extensions/String.md b/Documentation/Reference/extensions/String.md index f84e58de..230c1932 100644 --- a/Documentation/Reference/extensions/String.md +++ b/Documentation/Reference/extensions/String.md @@ -59,10 +59,10 @@ Converts a base64 encoded string to a base64-url encoded string. https://tools.ietf.org/html/rfc4648#page-7 -### `usPosixDate()` +### `usPosixDate(useIsoFormat:)` ```swift -public func usPosixDate() -> String +public func usPosixDate(useIsoFormat: Bool = true) -> String ``` ### `toBytes()` diff --git a/Documentation/Reference/protocols/MdocDecodable.md b/Documentation/Reference/protocols/MdocDecodable.md index f1e5c050..36e6667f 100644 --- a/Documentation/Reference/protocols/MdocDecodable.md +++ b/Documentation/Reference/protocols/MdocDecodable.md @@ -41,8 +41,27 @@ var nameSpaces: [NameSpace]? var title: String ``` +### `mandatoryElementKeys` + +```swift +var mandatoryElementKeys: [DataElementIdentifier] +``` + ### `displayStrings` ```swift var displayStrings: [NameValue] ``` + +### `displayImages` + +```swift +var displayImages: [NameImage] +``` + +## Methods +### `toJson()` + +```swift +func toJson() -> [String: Any] +``` diff --git a/Documentation/Reference/structs/ConferenceBadgeModel.md b/Documentation/Reference/structs/ConferenceBadgeModel.md new file mode 100644 index 00000000..276aa165 --- /dev/null +++ b/Documentation/Reference/structs/ConferenceBadgeModel.md @@ -0,0 +1,117 @@ +**STRUCT** + +# `ConferenceBadgeModel` + +**Contents** + +- [Properties](#properties) + - `response` + - `devicePrivateKey` + - `docType` + - `nameSpaces` + - `title` + - `family_name` + - `given_name` + - `expiry_date` + - `registration_id` + - `room_number` + - `seat_number` + - `ageOverXX` + - `displayStrings` + - `displayImages` + - `mandatoryElementKeys` + +```swift +public struct ConferenceBadgeModel: Codable, MdocDecodable +``` + +## Properties +### `response` + +```swift +public var response: DeviceResponse? +``` + +### `devicePrivateKey` + +```swift +public var devicePrivateKey: CoseKeyPrivate? +``` + +### `docType` + +```swift +public var docType = "com.example.conference.badge" +``` + +### `nameSpaces` + +```swift +public var nameSpaces: [NameSpace]? +``` + +### `title` + +```swift +public var title = String("conference_badge") +``` + +### `family_name` + +```swift +public let family_name: String? +``` + +### `given_name` + +```swift +public let given_name: String? +``` + +### `expiry_date` + +```swift +public let expiry_date: String? +``` + +### `registration_id` + +```swift +public let registration_id: UInt64? +``` + +### `room_number` + +```swift +public let room_number: UInt64? +``` + +### `seat_number` + +```swift +public let seat_number: UInt64? +``` + +### `ageOverXX` + +```swift +public var ageOverXX = [Int: Bool]() +``` + +### `displayStrings` + +```swift +public var displayStrings = [NameValue]() +``` + +### `displayImages` + +```swift +public var displayImages = [NameImage]() +``` + +### `mandatoryElementKeys` + +```swift +public var mandatoryElementKeys: [DataElementIdentifier] +``` diff --git a/Documentation/Reference/structs/DeviceEngagement.md b/Documentation/Reference/structs/DeviceEngagement.md index cba22ee4..6e185f5c 100644 --- a/Documentation/Reference/structs/DeviceEngagement.md +++ b/Documentation/Reference/structs/DeviceEngagement.md @@ -13,7 +13,7 @@ - `isBleServer` - `ble_uuid` - [Methods](#methods) - - `init(isBleServer:crv:)` + - `init(isBleServer:crv:rfus:)` - `init(data:)` ```swift @@ -77,10 +77,10 @@ public var ble_uuid: String? ``` ## Methods -### `init(isBleServer:crv:)` +### `init(isBleServer:crv:rfus:)` ```swift -public init(isBleServer: Bool?, crv: ECCurveType = .p256) +public init(isBleServer: Bool?, crv: ECCurveType = .p256, rfus: [String]? = nil) ``` Generate device engagement diff --git a/Documentation/Reference/structs/EuPidModel.md b/Documentation/Reference/structs/EuPidModel.md index 0c8a5177..2ceccae3 100644 --- a/Documentation/Reference/structs/EuPidModel.md +++ b/Documentation/Reference/structs/EuPidModel.md @@ -14,7 +14,6 @@ - `family_name` - `given_name` - `birth_date` - - `unique_id` - `family_name_birth` - `given_name_birth` - `birth_place` @@ -41,6 +40,9 @@ - `issuing_jurisdiction` - `ageOverXX` - `displayStrings` + - `displayImages` + - `pidMandatoryElementKeys` + - `mandatoryElementKeys` ```swift public struct EuPidModel: Codable, MdocDecodable @@ -101,12 +103,6 @@ public let given_name: String? public let birth_date: String? ``` -### `unique_id` - -```swift -public let unique_id: String? -``` - ### `family_name_birth` ```swift @@ -262,3 +258,21 @@ public var ageOverXX = [Int: Bool]() ```swift public var displayStrings = [NameValue]() ``` + +### `displayImages` + +```swift +public var displayImages = [NameImage]() +``` + +### `pidMandatoryElementKeys` + +```swift +public static var pidMandatoryElementKeys: [DataElementIdentifier] +``` + +### `mandatoryElementKeys` + +```swift +public var mandatoryElementKeys: [DataElementIdentifier] +``` diff --git a/Documentation/Reference/structs/GenericMdocModel.md b/Documentation/Reference/structs/GenericMdocModel.md index 4c901d33..d7007f81 100644 --- a/Documentation/Reference/structs/GenericMdocModel.md +++ b/Documentation/Reference/structs/GenericMdocModel.md @@ -12,6 +12,8 @@ - `title` - `ageOverXX` - `displayStrings` + - `displayImages` + - `mandatoryElementKeys` ```swift public struct GenericMdocModel: MdocDecodable @@ -59,3 +61,15 @@ public var ageOverXX = [Int: Bool]() ```swift public var displayStrings = [NameValue]() ``` + +### `displayImages` + +```swift +public var displayImages = [NameImage]() +``` + +### `mandatoryElementKeys` + +```swift +public var mandatoryElementKeys: [DataElementIdentifier] = [] +``` diff --git a/Documentation/Reference/structs/IsoMdlModel.md b/Documentation/Reference/structs/IsoMdlModel.md index b1af3c64..c56a759f 100644 --- a/Documentation/Reference/structs/IsoMdlModel.md +++ b/Documentation/Reference/structs/IsoMdlModel.md @@ -37,6 +37,7 @@ - `ageInYears` - `ageOverXX` - `displayStrings` + - `displayImages` - `ageBirthYear` - `portrait` - `unDistinguishingSign` @@ -47,8 +48,9 @@ - `signatureUsualMark` - `biometricTemplateFace` - `biometricTemplateSignatureSign` - - `mandatoryKeys` + - `isoMandatoryElementKeys` - `isoMandatoryKeys` + - `mandatoryElementKeys` ```swift public struct IsoMdlModel: Decodable, MdocDecodable @@ -247,6 +249,12 @@ public var ageOverXX = [Int: Bool]() public var displayStrings = [NameValue]() ``` +### `displayImages` + +```swift +public var displayImages = [NameImage]() +``` + ### `ageBirthYear` ```swift @@ -307,10 +315,10 @@ public let biometricTemplateFace: String? public let biometricTemplateSignatureSign: String? ``` -### `mandatoryKeys` +### `isoMandatoryElementKeys` ```swift -public static var mandatoryKeys: [String] +public static var isoMandatoryElementKeys: [DataElementIdentifier] ``` ### `isoMandatoryKeys` @@ -318,3 +326,9 @@ public static var mandatoryKeys: [String] ```swift public static var isoMandatoryKeys: [CodingKeys] ``` + +### `mandatoryElementKeys` + +```swift +public var mandatoryElementKeys: [DataElementIdentifier] +``` diff --git a/Documentation/Reference/structs/NameImage.md b/Documentation/Reference/structs/NameImage.md new file mode 100644 index 00000000..942e3fea --- /dev/null +++ b/Documentation/Reference/structs/NameImage.md @@ -0,0 +1,42 @@ +**STRUCT** + +# `NameImage` + +**Contents** + +- [Properties](#properties) + - `ns` + - `name` + - `image` +- [Methods](#methods) + - `init(name:image:ns:)` + +```swift +public struct NameImage +``` + +## Properties +### `ns` + +```swift +public let ns: String? +``` + +### `name` + +```swift +public let name: String +``` + +### `image` + +```swift +public let image: Data +``` + +## Methods +### `init(name:image:ns:)` + +```swift +public init(name: String, image: Data, ns: String? = nil) +``` diff --git a/Documentation/Reference/structs/NameValue.md b/Documentation/Reference/structs/NameValue.md index 0ce53e72..5512a5f0 100644 --- a/Documentation/Reference/structs/NameValue.md +++ b/Documentation/Reference/structs/NameValue.md @@ -9,9 +9,11 @@ - `name` - `value` - `order` + - `children` - `description` - [Methods](#methods) - - `init(name:value:ns:order:)` + - `init(name:value:ns:order:children:)` + - `add(child:)` ```swift public struct NameValue: Equatable, CustomStringConvertible @@ -42,6 +44,12 @@ public var value: String public var order: Int = 0 ``` +### `children` + +```swift +public var children: [NameValue]? +``` + ### `description` ```swift @@ -49,8 +57,14 @@ public var description: String ``` ## Methods -### `init(name:value:ns:order:)` +### `init(name:value:ns:order:children:)` + +```swift +public init(name: String, value: String, ns: String? = nil, order: Int = 0, children: [NameValue]? = nil) +``` + +### `add(child:)` ```swift -public init(name: String, value: String, ns: String? = nil, order: Int = 0) +public mutating func add(child: NameValue) ``` diff --git a/Documentation/Reference/structs/SignUpResponse.md b/Documentation/Reference/structs/SignUpResponse.md index d2010439..015612ef 100644 --- a/Documentation/Reference/structs/SignUpResponse.md +++ b/Documentation/Reference/structs/SignUpResponse.md @@ -77,7 +77,7 @@ A data file may contain signup responses with many documents (doc.types). ### `decomposeCBORSignupResponse(data:)` ```swift -public static func decomposeCBORSignupResponse(data: Data) -> [(docType: String, jsonData: Data)]? +public static func decomposeCBORSignupResponse(data: Data) -> [(docType: String, jsonData: Data, drData: Data, pkData: Data?)]? ``` Decompose CBOR signup responses from data