This is the Swiss implementation of the Electronic Healt Certificates (EHN) Specification [1] used to verify the validity of Digital Covid Certificates. It is partly based on the reference implementation of EHN's ValidationCore
[2].
The CovidCertificateSDK for iOS is work in progress and is not yet complete. We are continuing the development of this library, and the API is likely to change. Please contact the BIT before using / integrating this SDK in your app.
CrowdNotifierSDK is available through Swift Package Manager
- Add the following to your
Package.swift
file:
dependencies: [
.package(url: "https://github.com/admin-ch/CovidCertificate-SDK-iOS.git", .branch("main"))
]
This version points to the HEAD of the main
branch and will always fetch the latest development status. Future releases will be made available using semantic versioning to ensure stability for depending projects.
The SDK needs to be initialized with an environment. This allows for different verification rules per environment or other environment specific settings.
After initialization the following pipeline should be used:
-
Decode the base45 and prefixed string to retrieve a Digital Covid Certificate
-
Verify the signature of the Certificate
-
Check the revocation list. Currently always returns a valid
ValidationResult
-
Check for rules specific to countries such as validity of vaccines or tests
public func decode(encodedData: String) -> Result<DGCHolder, CovidCertError>
public static func checkSignature(cose: DGCHolder, _ completionHandler: @escaping (Result<ValidationResult, ValidationError>) -> Void)
Currently only stubs
public static func checkRevocationStatus(dgc: EuHealthCert, _ completionHandler: @escaping (Result<ValidationResult, ValidationError>) -> Void)
public static func checkNationalRules(dgc: EuHealthCert, _ completionHandler: @escaping (Result<VerificationResult, NationalRulesError>) -> Void)
[1] Health Certificate Specification
[2] Validation Core