DgcReader.TrustListProviders.Germany 2.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DgcReader.TrustListProviders.Germany --version 2.5.1                
NuGet\Install-Package DgcReader.TrustListProviders.Germany -Version 2.5.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DgcReader.TrustListProviders.Germany" Version="2.5.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DgcReader.TrustListProviders.Germany --version 2.5.1                
#r "nuget: DgcReader.TrustListProviders.Germany, 2.5.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DgcReader.TrustListProviders.Germany as a Cake Addin
#addin nuget:?package=DgcReader.TrustListProviders.Germany&version=2.5.1

// Install DgcReader.TrustListProviders.Germany as a Cake Tool
#tool nuget:?package=DgcReader.TrustListProviders.Germany&version=2.5.1                

German Trustlist provider

NuGet version (DgcReader.TrustListProviders.Germany)

Implementation of ITrustListProvider that uses the German endpoint for downloading the trusted public keys used for signature verification of the Digital Green Certificates.

This is an unofficial porting of the covpass-sdk included in the Digitaler-Impfnachweis / covpass-android repository

Usage

In order to use the provider, you can register it as a service or you can instantiate it directly, depending on how your application is designed:

a) Registering as a service:
public void ConfigureServices(IServiceCollection services)
{
   ...
   services.AddDgcReader()
       .AddGermanTrustListProvider(o =>       // <-- Register the GermanTrustListProvider service
       {
           // Optionally, configure the provider with custom options
           o.RefreshInterval = TimeSpan.FromHours(24);
           o.MinRefreshInterval = TimeSpan.FromHours(1);
           ...
       });
}
b) Instantiate it directly
...
// You can use the constructor
var trustListProvider = new GermanTrustListProvider(httpClient);
...

// Or you can use the GermanTrustListProvider.Create facory method
// This will help you to unwrap the IOptions interface when you specify 
// custom options for the provider:
var trustListProvider = GermanTrustListProvider.Create(httpClient, 
   new GermanTrustListProviderOptions {
       RefreshInterval = TimeSpan.FromHours(24),
       MinRefreshInterval = TimeSpan.FromHours(1),
   });

Available options

  • RefreshInterval: interval for checking for an updated trustlist from the server. Default value is 24 hours.
  • MinRefreshInterval: if specified, prevents that every validation request causes a refresh attempt when the current trustlist is expired.
    For example, if the parameter is set to 5 minutes and the remote server is unavailable when the RefreshInterval is expired, subsequent validation requests won't try to download an updated trustlist for 5 minutes before making a new attempt. Default value is 5 minutes.
  • UseAvailableListWhileRefreshing: if true, allows the provider to return the expired list loaded in memory, while downloading an updated list on a background Task.
    This prevents the application to wait that the new full list of certificates is downloaded, extending by the time needed for the download the effective validitiy of the trustlist already loaded.
    As result, the response time of the application will be nearly instantanious, except for the first download or if the trustlist has reached the MaxFileAge value.
    Otherwise, if the list is expired, every trustlist request will wait untill the refresh task completes.
  • TryReloadFromCacheWhenExpired: If true, try to reload values from cache before downloading from the remote server. This can be useful if values are refreshed by a separate process, i.e. when the same valueset cached file is shared by multiple instances for reading. Default value is false.
  • BasePath: base folder where the trust list will be saved.
    The default value is Directory.GetCurrentDirectory()
  • MaxFileAge: maximum duration of the configuration file before is discarded.
    If a refresh is not possible when the refresh interval expires, the current file can be used until it passes the specified period.
    This allows the application to continue to operate even if the backend is temporary unavailable for any reason. Default value is 15 days.
  • SaveCertificate: if true, the full .cer certificate downloaded is saved into the json file instead of only the public key parameters.
    This option is enabled by default, as may be required by some rule validators in order to perform additional checks.
  • SaveSignature: if true, the signature of the certificate entry will be stored into the json file. This option is disabled by default, and can be activated for diagnostic purposes.

Forcing the update of the trustlist

If the application needs to update the trustlist at a specific time (i.e. by a scheduled task, or when a user press a "Refresh" button), you can simply call the RefreshTrustList function of the provider. This will casue the immediate refresh of the rules from the remote server, regardless of the options specified.


Copyright © 2021 Davide Trevisan
Licensed under the Apache License, Version 2.0

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 is compatible.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.6.1 240 4/3/2023
2.6.0 202 4/2/2023
2.6.0-CI-20230402-140522 123 4/2/2023
2.5.5 410 6/14/2022
2.5.5-rc1 145 6/14/2022
2.5.5-CI-20230402-112357 127 4/2/2023
2.5.5-CI-20230402-101020 111 4/2/2023
2.5.4 408 5/4/2022
2.5.4-rc2 156 5/4/2022
2.5.4-rc1 152 5/4/2022
2.5.3 921 3/5/2022
2.5.3-rc1 163 3/5/2022
2.5.1 426 2/16/2022
2.5.1-rc1 151 2/15/2022
2.5.0 428 2/14/2022
2.5.0-rc3 151 2/14/2022
2.5.0-rc2 162 2/11/2022
2.5.0-rc1 157 2/11/2022
2.4.0 406 2/6/2022
2.3.0 426 1/28/2022
2.2.1 404 1/21/2022
2.2.0 246 1/16/2022
2.1.0 264 1/6/2022
2.0.0 253 12/27/2021