Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for cbor data, Document getCborData() returns IssuerSigned #11

Merged
merged 4 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git",
"state" : {
"revision" : "f9811c94bdd6ea756a14f00aff9507eb932ae03d",
"version" : "0.2.0"
"revision" : "39134521d5c8df9302e60a1d98d3cb6405253d12",
"version" : "0.2.4"
}
},
{
Expand All @@ -30,10 +30,10 @@
{
"identity" : "swiftcbor",
"kind" : "remoteSourceControl",
"location" : "https://github.com/scytales-com/SwiftCBOR.git",
"location" : "https://github.com/niscy-eudiw/SwiftCBOR.git",
"state" : {
"revision" : "b23ed1e83d5daa3dfaf73846bee06a4681fea55f",
"version" : "0.5.0"
"revision" : "310dbc3975a5653237fed304d88a6dd59d04dd30",
"version" : "0.5.7"
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions 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.1.8"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-ios-iso18013-data-model.git", from: "0.2.4"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -28,6 +28,6 @@ let package = Package(
]),
.testTarget(
name: "WalletStorageTests",
dependencies: ["WalletStorage"]),
dependencies: ["WalletStorage"], resources: [.process("Resources")]),
]
)
10 changes: 5 additions & 5 deletions Sources/eudi-lib-ios-wallet-storage/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public struct Document {
public let modifiedAt: Date?

/// get CBOR data and private key from document
public func getCborData() -> (dr: DeviceResponse, dpk: CoseKeyPrivate)? {
public func getCborData() -> (iss: IssuerSigned, dpk: CoseKeyPrivate)? {
switch docDataType {
case .signupResponseJson:
guard let sr = data.decodeJSON(type: SignUpResponse.self), let dr = sr.deviceResponse, let dpk = sr.devicePrivateKey else { return nil }
return (dr,dpk)
guard let sr = data.decodeJSON(type: SignUpResponse.self), let dr = sr.deviceResponse, let iss = dr.documents?.first?.issuerSigned, let dpk = sr.devicePrivateKey else { return nil }
return (iss, dpk)
case .cbor:
guard let dr = DeviceResponse(data: [UInt8](data)), let privateKeyType, let privateKey, let dpk = try? IssueRequest(id: id, privateKeyType: privateKeyType, keyData: privateKey).toCoseKeyPrivate() else { return nil }
return (dr,dpk)
guard let iss = IssuerSigned(data: [UInt8](data)), let privateKeyType, let privateKey, let dpk = try? IssueRequest(id: id, privateKeyType: privateKeyType, keyData: privateKey).toCoseKeyPrivate() else { return nil }
return (iss, dpk)
case .sjwt:
fatalError("Format \(docDataType) not implemented")
}
Expand Down
1 change: 1 addition & 0 deletions Tests/WalletStorageTests/Resources/eu_pid_base64.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
omppc3N1ZXJBdXRohEOhASahGCFZAoUwggKBMIICJqADAgECAgkWSuWZAtwFEGQwCgYIKoZIzj0EAwIwWDELMAkGA1UEBhMCQkUxHDAaBgNVBAoTE0V1cm9wZWFuIENvbW1pc3Npb24xKzApBgNVBAMTIkVVIERpZ2l0YWwgSWRlbnRpdHkgV2FsbGV0IFRlc3QgQ0EwHhcNMjMwNTMwMTIzMDAwWhcNMjQwNTI5MTIzMDAwWjBlMQswCQYDVQQGEwJCRTEcMBoGA1U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u-BIdtm01ivNfqejekxh9oBJ5GwXAwHJVfB9IpYoLt_Jg36hMwxwKnObQXc6Gsiq0CFvaloZGlnZXN0SUQYJWxlbGVtZW50VmFsdWViU0VxZWxlbWVudElkZW50aWZpZXJvaXNzdWluZ19jb3VudHJ52BhYjqRmcmFuZG9tWEB6pSEMLXaDJFLYp7zIqS2uWV-MiN9atCpSDe5nsvhb1gNZOa12EWihlFJEr57u0hqAy5pgSuE4FLR-ExI_WF3laGRpZ2VzdElEGBpsZWxlbWVudFZhbHVlZFNFLUlxZWxlbWVudElkZW50aWZpZXJ0aXNzdWluZ19qdXJpc2RpY3Rpb24
24 changes: 24 additions & 0 deletions Tests/WalletStorageTests/WalletStorageTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import XCTest
import Foundation
@testable import WalletStorage
import MdocDataModel18013

final class WalletStorageTests: XCTestCase {


func testIssueRequestPublicKey() throws {
let ir = try IssueRequest()
let pem = try ir.getPublicKeyPEM()
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")
}


}

This file was deleted.

Loading