-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/1.3.1 (eu-digital-green-certificates#130)
* no message * added new UI * Ticketing solution logic update - Added model to handle QR scan from ticket service - Added blueprint of method to obtain list of auth services * Refactored list of service method * Implemented method to fetch list of services * added new UI * server list view controller * Access token for ticketing - Request implemented - Model for response added * added selected and deselected state * List of services implemented * Public key generation added * Small refactoring to avoid crash * AccessTokenRequest fixed - Filtering for certificates added * Selection code adjusted with model * Comment removed * fixed small UI bugs * Consent screen added - request for validation added * Fixed UI part of selection of cert * xnonce added * Fixed navigation in wallet app * Fixed navigation and cells. Added Certificate controller to navigation. * Added services controller * Remove obsolete sources * Removed unnecessary fields * minor fixes * Replaced x-buttons * Removed unnecessary code * Validation request added * Refactored ut8 string to base64decoded data * Code clean up * Identity services refactored * Code clean up * Validation Result view controller added * fixed QR class * Fixed navigation * Fixed navigation * Bug fix session eu-digital-green-certificates#108 eu-digital-green-certificates#111 eu-digital-green-certificates#113 * Added remove certificate functionality * Added delete alert * Fixed deleting * Fixed reload bug in ListCertificates * Add Developer Team * Changed cert compare * Fixed certificates table with edit * Added 2 controller files to storyboard * Fixed crash on verification result if no validation info passed * Update project * Scan Moved from Core * Added viewers to storyboard * Added remove messages to ImageViewer and PDF * Fixed Remove action * Removed xibs from controllers * Minor fix storyboard * Removed last xib * Fixed deleting, crash with race and some textes * Fix public in Date extention * Added activity check * Fixed crash with reload table * Added flash of added item * Added OK button * Fixed rule cell * Updated buttons * Fixed Grant layout * Minor fix * Fix crash with adding certs * minor fix * Fix selecting of sertificates * Added new version * added logsto requests * remove print * Fixed posting certificates * Added delete button * Removed FloatingPanel, Added delete certificate button * Finalized remove certificate * Fixed layout * Fixed deleting calbacks * Removed FloatingPanel package * Removed FloatingPanel resources * removed unnecessary import directives * Aded common core * Removed errors with cert * Fixed wallet app after core mege * fix in project tree * Access token info added on Certificate list screen * fixed storyboards * minor fixes * Added activity indicator * Added config * Fixed navigation issues * Fixed classe names in storyboards * fixed fetch time * Fixed reloadingData * fixed storyboard - added reload cell * Added reload after dismissing * Fixed Scan of ticketing QR code * minor changes in project tree * Fixed page controller * removed selected country code * Fixed landscape orientation for iPad * refactor UI cells * increased build num * temp data * correct data * fixed project settings * Fixed issue - Certificate for Ticketing can not be found * Added loading to confirm validity * x5c type changed in PublicKeyJWK structure Replaced x5c type of String with [String] in order to follow backend changes * Refactor controller names and data managers * fixed crash in ticketing * Business data were removed from TicketingAcceptanceController controller * Fixed back buttons * added background * Added Alerts to the Ticketing * refactor project tree * Replaced UserDefaults storage with keyChain * removed queue from request * Updated localization strings * Changed in localizations * Removed keys from Localization file * Added Safe thread array. * Fixed string format * Added de-localization * Added localisations to resource files * Added app localised name * Fixed localizations * Added localized property. Added alert on save PDF, fixed alerts * Optimised loading on main screen * Fixed reload page on main screen * Fixed layout in Image and PDF cells * Fixed reload table on main screen * upgrade version num * Fixed Localized strings * Added one line to localization * Refactored Access Token functionality * Added error processing to the ticketing * Fix verification fields * Fixed search of validation data * Fixed main thread methods * Fixed incorrect alert messages * Updated localized strings * Fixed json logic * Added revocation to walllet * removed database * removed dismiss delegate (added timer) * feat: revocation * fix: revocation lookup * chore: version 1.3.1 * fix: exp bug Co-authored-by: Alexandr Chernyy <[email protected]> Co-authored-by: Illia Vlasov <[email protected]> Co-authored-by: Test <[email protected]> Co-authored-by: ikhomiak <[email protected]> Co-authored-by: IgorKhomiak <[email protected]>
- Loading branch information
1 parent
db6fc44
commit d23a50c
Showing
6 changed files
with
210 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
/*- | ||
* ---license-start | ||
* eu-digital-green-certificates / dgca-wallet-app-ios | ||
* --- | ||
* Copyright (C) 2021 T-Systems International GmbH and all other contributors | ||
* --- | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* ---license-end | ||
*/ | ||
// | ||
// Data.swift | ||
// DGCAWallet | ||
// | ||
// Created by Paul Ballmann on 01.03.22. | ||
// | ||
|
||
|
||
import Foundation | ||
|
||
extension Data { | ||
func urlSafeBase64EncodedString() -> String { | ||
return base64EncodedString() | ||
.replacingOccurrences(of: "+", with: "-") | ||
.replacingOccurrences(of: "/", with: "_") | ||
.replacingOccurrences(of: "=", with: "") | ||
} | ||
} |
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,84 @@ | ||
// | ||
/*- | ||
* ---license-start | ||
* eu-digital-green-certificates / dgca-wallet-app-ios | ||
* --- | ||
* Copyright (C) 2021 T-Systems International GmbH and all other contributors | ||
* --- | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* ---license-end | ||
*/ | ||
// | ||
// JWT.swift | ||
// DGCAWallet | ||
// | ||
// Created by Paul Ballmann on 01.03.22. | ||
// | ||
|
||
|
||
import Foundation | ||
import CryptoKit | ||
import SwiftDGC | ||
|
||
struct Header: Encodable { | ||
let alg = "ES256" | ||
let typ = "JWT" | ||
} | ||
|
||
struct Payload: Encodable { | ||
let sub: String | ||
let payload: [String] | ||
let exp: Double | ||
} | ||
|
||
class DGCAJwt { | ||
private static func makeJwtPayload(cert: HCert) -> Payload { | ||
let payload: [String] = [cert.uvciHash![0..<(cert.uvciHash!.count/2)].toHexString(), | ||
cert.signatureHash![0..<(cert.signatureHash!.count/2)].toHexString(), | ||
cert.countryCodeUvciHash![0..<(cert.countryCodeUvciHash!.count/2)].toHexString()] | ||
return Payload(sub: cert.uvciHash!.toHexString(), payload: payload, exp: cert.exp.timeIntervalSince1970) | ||
} | ||
// payload: Payload, with keyPair: SecKey | ||
public static func makeJwtAndSign(fromCerts certs: [HCert], completion: @escaping (Bool, [String]?, Error?) -> Void) { | ||
var tokens: [String] = [] | ||
for cert in certs { | ||
do { | ||
let payload = DGCAJwt.makeJwtPayload(cert: cert) | ||
let headerDataBase64 = try JSONEncoder().encode(Header()).urlSafeBase64EncodedString() | ||
let payloadBase64 = try JSONEncoder().encode(payload).urlSafeBase64EncodedString() | ||
let toSign = Data((headerDataBase64 + "." + payloadBase64).utf8) | ||
Enclave.sign(data: toSign, with: cert.keyPair, using: .ecdsaSignatureMessageX962SHA256) { sign, err in | ||
guard err == nil else { | ||
completion(false, nil, GatewayError.local(description: err!)) | ||
return | ||
} | ||
guard let sign = sign else { | ||
completion(false, nil, GatewayError.local(description: err!)) | ||
return | ||
} | ||
let signatureBase64 = sign.urlSafeBase64EncodedString() | ||
let token = [headerDataBase64, payloadBase64, signatureBase64].joined(separator: ".") | ||
// completion(true, token, nil) | ||
tokens.append(token) | ||
if tokens.count == certs.count { | ||
completion(true, tokens, nil) | ||
} | ||
} | ||
} catch { | ||
print(error) | ||
completion(false, nil, error) | ||
return | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.