This repository contains the source code of the EU Digital COVID Certificate Certlogic for iOS.

Overview

EU Digital COVID Certificate - Certlogic iOS

AboutDevelopmentDocumentationSupportContributeContributorsLicensing Assumptions Testing & Status

About

This repository contains the source code of the EU Digital COVID Certificate Certlogic for iOS.

The Digital COVID Certificate (DCC) allows to determine whether a person is deemed fit-for-travel into a country-of-arrival (CoA) based on their vaccination, test, and recovery status. To make such determinations, business (or validation, or verification) rules have to be implemented in verifier and wallet apps.

This module allows integrating the certlogic in iOS apps.

This repository contains a framework to implement in verifier apps (and backends) using a CertLogicEngine. It explains how to do that in a way that makes these rules interchangeable across implementors. The advantage of this approach is that it ultimately allows citizens to check their fit-for-travel status into an intended CoA ahead of travel, against the actual rules.

This can be achieved by adhering to a common, and testable and verifiable way of defining, and executing rules. The interchangeable rules are uploaded to, and can be downloaded from the EU Digital COVID Certificate Gateway (DGCG) - more info can be found here.

An example of a rule can be found here.

This work is a result of work done by the EU Taskforce Business Rules, and described in this document. The (JSON Schema) technical specification for the EU DCC can be found here.

Development

Prerequisites

This library automaticaly added in dependencies and downloading by XCode Swift Package Manager

Using Swift Package Manager

if you use Swift Package Manager add the following in dependencies:

    dependencies: [
    .package(
        url: "https://github.com/eu-digital-green-certificates/dgc-certlogic-ios", from: "1.0.0"
    )
]

if you want to use CertLogic as XCode project please use script for generate certlogic.xcodeproj and add this project directly

generate-xcodeproj.sh

Assumptions

Various code in this repo assumes that you've cloned the following two repos right next to where this repo's cloned:

Testing & Status

  • If you found any problems, please create an Issue.
  • Current status: Work-In-Progress.

Documentation

Support and feedback

The following channels are available for discussions, feedback, and support requests:

Type Channel
Issues
Other requests

How to contribute

Contribution and feedback is encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines. By participating in this project, you agree to abide by its Code of Conduct at all times.

Contributors

Our commitment to open source means that we are enabling - in fact encouraging - all interested parties to contribute and become part of its developer community.

Licensing

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 https://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.

Comments
  • Different results for the same certificate under Android and iOS (Corona-Warn-App and CovPass-App)

    Different results for the same certificate under Android and iOS (Corona-Warn-App and CovPass-App)

    Describe the bug

    Checking the same certificate under iOS and Android against the Swiss leas to two different results:

    | Android | iOS | |---|---| | twitter_2qSdoXWn | |

    Same goes for CovPass under iOS and under Android, iOS shows fail, Android shows the open status.

    Expected behaviour

    The result should be the same under iOS and Android.

    Steps to reproduce the issue

    1. Add a EU DCC to the Corona-Warn-App under iOS & under Android.
    2. Select "Check Validity"
    3. Select "Switzerland"
    4. See the result

    Technical details

    • iPhone XR
    • iOS 15.0.1
    • CWA 2.10.2
    • Huawei P Smart 2019
    • Android 10
    • CWA 2.10.1

    Additional context

    I hope this is the right place for this issue.

    bug 
    opened by Ein-Tim 20
  • Rules that fail with a (technical) exceptions should be reported as Open instead of Fail

    Rules that fail with a (technical) exceptions should be reported as Open instead of Fail

    Describe the bug

    When a rule fails with a (technical) exception instead of returning true/false, the rule is reported as fail: https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/a478f350183b467929450966d5a2cf7599bdff4d/Sources/CertLogic/CertLogic.swift#L71

    Expected behaviour

    It should be reported as open.

    Steps to reproduce the issue

    look at the code

    Technical details

    n/a

    Possible Fix

    see expected behavior

    Additional context

    n/a

    bug 
    opened by mlenkeit 5
  • Dependency of 'json-logic-swift' is not updated to 1.1.7

    Dependency of 'json-logic-swift' is not updated to 1.1.7

    Describe the bug

    The documentation was updated to support 'extractFromUVCI' but the dependency to 'json-logic-swift' was not updated. The version 1.1.7 of 'json-logic-swift' contains support for 'extractFromUVCI'.

    Expected behaviour

    Dependency of 'json-logic-swift' is updated to 1.1.7

    bug 
    opened by ArturFriesen 4
  • Add coding for Rule.hash

    Add coding for Rule.hash

    Problem

    The Rule class gets encoded without the hash, but the value is needed to compare the rule when checking for updates.

    Solution

    Added support to encode/decode the hash. Also made a small adjustment to use the right coding method for region

    opened by timokoenig 4
  • Check for `EngineVersion` attribute missing

    Check for `EngineVersion` attribute missing

    Describe the bug

    There is currently no check for the value of the EngineVersion attribute of a rule:

    https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/14bcdce4ed19e151a9a3df1ea253db9a6238eeb7/Sources/CertLogic/CertLogic.swift#L51-L70

    Expected behaviour

    If a rule has the attribute Engine with value CERTLOGIC and EngineVersion has a value other than 1.0.0, the rule is not evaluated but reported as open.

    Steps to reproduce the issue

    see code

    Technical details

    n/a

    Possible Fix

    add if statement

    Additional context

    n/a

    bug 
    opened by mlenkeit 4
  • [VH] Rule filtering by date ignores time zone information if milliseconds are absent

    [VH] Rule filtering by date ignores time zone information if milliseconds are absent

    Describe the bug

    A ValidFrom date 2021-07-22T16:34:33+02:00 is parsed as 16:34:33 UTC. Supposedly only happens if the date string does not have milliseconds.

    Expected behaviour

    A ValidFrom date 2021-07-22T16:34:33+02:00 should parsed as 14:34:33 UTC

    Steps to reproduce the issue

    Parse date 2021-07-22T16:34:33+02:00 and check output

    Technical details

    n/a

    Possible Fix

    somewhere here https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/257fa209c053ca4bc05629ece867f2f30bc45a3f/Sources/CertLogic/Date+.swift

    Additional context

    n/a

    bug 
    opened by mlenkeit 3
  • Small typo

    Small typo "vaccination" in CertificationType

    Describe the bug

    The CertificateType.vacctination has a small typo.

    Expected behaviour

    It should be named CertificateType.vaccination.

    Steps to reproduce the issue

    Sources/CertLogic/CertLogic.swift: Line 233 and 250 Sources/CertLogic/Rule.swift: Line 20

    Technical details

    Possible Fix

    Use renaming functionality of Xcode.

    Additional context

    bug 
    opened by pascal-brause 3
  • Check for `Engine` attribute missing

    Check for `Engine` attribute missing

    Describe the bug

    There is currently no check for the value of the Engine attribute of a rule:

    https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/14bcdce4ed19e151a9a3df1ea253db9a6238eeb7/Sources/CertLogic/CertLogic.swift#L51-L70

    Expected behaviour

    If a rule has the attribute Engine with a value other than CERTLOGIC, the rule is not evaluated but reported as open.

    Steps to reproduce the issue

    see code

    Technical details

    n/a

    Possible Fix

    add if statement

    Additional context

    n/a

    bug 
    opened by mlenkeit 3
  • [VH] Rule filtering for `region` considers rules of all regions of a country if no region is provided

    [VH] Rule filtering for `region` considers rules of all regions of a country if no region is provided

    Describe the bug

    The following code block tries to filter all general acceptance rules for the country and - if a region is set - continues to filter them for the provided region:

    https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/14bcdce4ed19e151a9a3df1ea253db9a6238eeb7/Sources/CertLogic/CertLogic.swift#L114-L121

    However, there's a flaw in this logic:

    If no region is provided, the first sequence will contain rules of all the regions of the country.

    Expected behaviour

    If no region is provided, only rules without an empty/nulled region should be filtered for. Otherwise, there can easily be contradicting rules from different regions.

    Steps to reproduce the issue

    see code

    Technical details

    n/a

    Possible Fix

    adjust filtering by region

    Additional context

    • same applies to the other rule filtering logic pieces for invalidation rules and certificate type-specific rules
    bug 
    opened by mlenkeit 3
  • JSON encoding/decoding not consistent

    JSON encoding/decoding not consistent

    Describe the bug

    The encoding and decoding of a Rule is not consistent, i.e. not all fields are encoded, e.g.:

    • logic is decoded but not encoded in encode
    • countryCode is decoded not encoded in encode
    • affectedString is encoded twice

    https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/a4b10d4d591ae32989587836a3d002659a71c024/Sources/CertLogic/Rule.swift#L154-L185

    Expected behaviour

    Encoding and decoding read/set the same fields/attributes.

    Steps to reproduce the issue

    See code sample

    Technical details

    n/a

    Possible Fix

    use same fields for encoding and decoding

    Additional context

    n/a

    bug 
    opened by mlenkeit 3
  • No support for Test Certificates and Recovery Certificates / Hard-coded to Vaccination Certificates

    No support for Test Certificates and Recovery Certificates / Hard-coded to Vaccination Certificates

    Describe the bug

    The current code is hard-wired to Vaccination Certificates, e.g. in

    https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/a478f350183b467929450966d5a2cf7599bdff4d/Sources/CertLogic/CertLogic.swift#L40

    Rules for other certificate types cannot be executed.

    Also, there is no filtering of the CertificateType property, like there is in the Android library:

    https://github.com/eu-digital-green-certificates/dgc-certlogic-android/blob/d9bd5136036f0db3c2648d70916cbaeb0851b2a3/engine/src/main/java/dgca/verifier/app/engine/data/source/RulesDataSource.kt#L27

    Expected behaviour

    • validate does not do any filtering directly but receives a pre-filtered set of rules like it is on Android
    • add utilities that facilitate filtering outside of the validate method (like there are on Android, see https://github.com/eu-digital-green-certificates/dgc-certlogic-android/blob/d9bd5136036f0db3c2648d70916cbaeb0851b2a3/engine/src/main/java/dgca/verifier/app/engine/data/source/RulesDataSource.kt#L27)

    Steps to reproduce the issue

    take a look at the code

    Technical details

    n/a

    Possible Fix

    see expected behavior

    Additional context

    n/a

    bug 
    opened by mlenkeit 3
  • ValidationResult passed without Rule

    ValidationResult passed without Rule

    Your Question

    • Source File: https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/blob/main/Sources/CertLogic/ValidationResult.swift
    • Line(s):
    • Question: Hey there, im asking me if it is possible that we got a ValidationResult which passes but has no rule and/or validationErrors property (rule = nil and validationErrors = nil) This question is because the properties rule and validationErrors are optionals.
    question 
    opened by Kurt57 0
  • Cert logic main updated

    Cert logic main updated

    Some classes are replaced to structs if possible. Removed methods that can be created by system All variable properties that are not changed after creating replaced to constants

    opened by ihorkhomyak 0
  • Compiler warning with Xcode 13.

    Compiler warning with Xcode 13.

    Describe the bug

    When update to latest swift packages with Xcode 13.0, i receive a compiler warning that some file is not found. Cleaning, removing derived data and module cache and rebuilding and refetching did not work.

    See attached image.

    Bildschirmfoto 2021-09-29 um 15 39 33

    Expected behaviour

    No compiler warning will be thrown when building.

    bug 
    opened by pascal-brause 2
  • Improve performance by reducing the number of times the same data is parsed

    Improve performance by reducing the number of times the same data is parsed

    1. getJSONStringForValidation(external: external, payload: payload) is not unnecessarily repeated in the forEach loop for every rule
    2. the JsonLogic object is created only once in the Rule and stored in a private var. This avoids the rather expensive parsing of the JsonLogic object many times if the same rule is evaluated for many certificates
    opened by martinreichart 2
  • Add AppVersion to External Parameters

    Add AppVersion to External Parameters

    To differentiate different app versions within the rule, an additional parameter should be added to external parameters. This would be a nice feature if any kind of rule execution logic has a "bug" or any other problem in a special app version. The rule can then differentiate between different apps inside the rule.

    enhancement 
    opened by SchulzeStTSI 0
Releases(1.3.2)
  • 1.3.2(May 19, 2022)

    What's Changed

    • Feature/fixed date formatter by @ihorkhomyak in https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/pull/54

    Full Changelog: https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/compare/1.3.1...1.3.2

    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(May 18, 2022)

    What's Changed

    • increased jsonlogic version by @ihorkhomyak in https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/pull/53

    Full Changelog: https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/compare/1.3...1.3.1

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(May 17, 2022)

    What's Changed

    • Feat/fiixed cert logic by @ihorkhomyak in https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/pull/52

    Full Changelog: https://github.com/eu-digital-green-certificates/dgc-certlogic-ios/compare/1.2.0...1.3.0

    Source code(tar.gz)
    Source code(zip)
Owner
Official GitHub Organization of the EU Digital COVID Certificates (EUDCC) project, previously known as the EU Digital Green Certificates (DGC).
null
APT repository app for jailbroken iOS devices

Find Your Repos! RepoFinder is here to bring you a seamless way to add all of your favorite repositories right into the package manager of your choice

Jacob Singer 25 Dec 20, 2022
IrohaCrypto - This repository is managed by Terraform!

IrohaCrypto Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation IrohaC

ソラミツ 0 Dec 23, 2021
Open-source jailbreaking tool for many iOS devices

Open-source jailbreaking tool for many iOS devices *Read disclaimer before using this software. checkm8 permanent unpatchable bootrom exploit for hund

null 0 Nov 6, 2021
An easy-to-use, open-source two-factor authentication app designed specifically for iOS.

Tofu An easy-to-use, open-source two-factor authentication app designed specifically for iOS. Tofu generates one-time passwords to help you protect yo

Calle Luks 380 Jan 8, 2023
The minimalistic, secure and open-source two-factor authentication app.

Einmal /ˈainmaːl/ German: once The minimalistic, secure and open-source two-factor authentication app. Features ♻️ Cross-platform — available on Andro

Incipher 75 Aug 21, 2022
A customizable verification code textField. Can be used for phone verification codes, passwords etc

KKPinCodeTextField A customizable verification code textField. Can be used for phone verification codes, passwords etc. Настраиваемое текстовое поле д

Kolesa Group 66 Jul 5, 2022
Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities.

Description Oversecured Vulnerable iOS App is an iOS app that aggregates all the platform's known and popular security vulnerabilities. List of vulner

Oversecured Inc 135 Dec 15, 2022
Pass for iOS - an iOS client compatible with Pass command line application.

Pass is an iOS client compatible with ZX2C4's Pass command line application. It is a password manager using GPG for encryption and Git for version control.

Mingshen Sun 1.3k Dec 26, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
CCCryptor (AES encryption) wrappers for iOS and Mac in Swift. -- For ObjC, see RNCryptor/RNCryptor-objc

RNCryptor Cross-language AES Encryptor/Decryptor data format. The primary targets are Swift and Objective-C, but implementations are available in C, C

null 3.3k Dec 30, 2022
Safe and easy to use crypto for iOS and macOS

Swift-Sodium Swift-Sodium provides a safe and easy to use interface to perform common cryptographic operations on macOS, iOS, tvOS and watchOS. It lev

Frank Denis 483 Jan 5, 2023
Helper functions for saving text in Keychain securely for iOS, OS X, tvOS and watchOS.

Helper functions for storing text in Keychain for iOS, macOS, tvOS and WatchOS This is a collection of helper functions for saving text and data in th

Evgenii Neumerzhitckii 2.3k Dec 28, 2022
Simple Swift wrapper for Keychain that works on iOS, watchOS, tvOS and macOS.

KeychainAccess KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much mor

Kishikawa Katsumi 7.2k Dec 30, 2022
A simple Swift Keychain Wrapper for iOS, watchOS, and OS X.

Latch A simple Swift 2.0 Keychain Wrapper for iOS, watchOS 2, and OS X. Usage A proper example of how to use Latch can be seen in the tests. import La

Danielle 56 Oct 25, 2022
A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.

SwiftKeychainWrapper A simple wrapper for the iOS / tvOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift. Prov

Jason 1.5k Dec 30, 2022
RSA public/private key encryption, private key signing and public key verification in Swift using the Swift Package Manager. Works on iOS, macOS, and Linux (work in progress).

BlueRSA Swift cross-platform RSA wrapper library for RSA encryption and signing. Works on supported Apple platforms (using Security framework). Linux

Kitura 122 Dec 16, 2022
Valet lets you securely store data in the iOS, tvOS, or macOS Keychain without knowing a thing about how the Keychain works.

Valet Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy.

Square 3.8k Jan 4, 2023
🔒 Swift Obfuscator that protects iOS apps against reverse engineering attacks.

struct fjiovh4894bvic: XbuinvcxoDHFh3fjid { let VNfhnfn3219d: Vnahfi5n34djga func cxncjnx8fh83FDJSDd() -> Lghbna2gf0gmh3d { return vPAOSNdcbif

Bruno Rocha 2.1k Jan 9, 2023
Simple Objective-C wrapper for the keychain that works on Mac and iOS

SAMKeychain SAMKeychain is a simple wrapper for accessing accounts, getting passwords, setting passwords, and deleting passwords using the system Keyc

Sam Soffes 5.4k Dec 29, 2022