Skip to content

Commit

Permalink
Merge pull request #22 from eu-digital-identity-wallet/develop
Browse files Browse the repository at this point in the history
Document implements DocumentProtocol
  • Loading branch information
phisakel committed Sep 5, 2024
2 parents 28acebc + 3363135 commit f3ecad8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git",
"state" : {
"revision" : "bf62cc73ae2cea61e98020d2d037c153500207e7",
"version" : "0.2.5"
"revision" : "e604f0f0b67c86c3360f848defe85c9a9939b716",
"version" : "0.3.1"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "d029d9d39c87bed85b1c50adee7c41795261a192",
"version" : "1.0.6"
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
"version" : "1.5.4"
"revision" : "9cb486020ebf03bfa5b5df985387a14a98744537",
"version" : "1.6.1"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", from: "0.2.5"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", from: "0.3.1"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
3 changes: 2 additions & 1 deletion Sources/WalletStorage/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation
import MdocDataModel18013

/// wallet document structure
public struct Document {
public struct Document: DocumentProtocol {
public init(id: String = UUID().uuidString, docType: String, docDataType: DocDataType, data: Data, privateKeyType: PrivateKeyType?, privateKey: Data?, createdAt: Date?, modifiedAt: Date? = nil, displayName: String?, status: DocumentStatus) {
self.id = id
self.docType = docType
Expand All @@ -42,6 +42,7 @@ public struct Document {
public let modifiedAt: Date?
public let displayName: String?
public let status: DocumentStatus
public var statusDescription: String? { status.rawValue }
public var isDeferred: Bool { status == .deferred }

/// get CBOR data and private key from document
Expand Down
1 change: 0 additions & 1 deletion Tests/WalletStorageTests/Resources/eu_pid_base64.txt

This file was deleted.

8 changes: 1 addition & 7 deletions Tests/WalletStorageTests/WalletStorageTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ final class WalletStorageTests: XCTestCase {
XCTAssert(Bool(pem.count > 0))
print(pem)
}

func testLoadPidIssuerSigned() {
let base64str = String(data: Data(name: "eu_pid_base64", ext: "txt", from: Bundle.module)!, encoding: .utf8)!
let pidIssueredSignedData = [UInt8](Data(base64URLEncoded: base64str.trimmingCharacters(in: .whitespacesAndNewlines))!)
let pidIssueredSigned = IssuerSigned(data: pidIssueredSignedData)
XCTAssertEqual(EuPidModel.euPidDocType, pidIssueredSigned?.issuerNameSpaces?.nameSpaces.map(\.key).first, "Test data contains PID doc type")
}



}

0 comments on commit f3ecad8

Please sign in to comment.