.NET-SDK
Destinations verwalten
Das .NET SDK ermöglicht das Erstellen, Bearbeiten und eventuelle Löschen von Zustellpunkte (auch Destinations genannt).
Für die Verwaltung von Destinations braucht man:
- Credentials: Um einen Destination zu erstellen, braucht man eine Client-ID (Zugangs-Kennung) und ein Client-Secret (Zugangs-Geheimnis). Hier ist beschrieben, wie man diese Credentials erhält.
- Schlüssel zum Entschlüsseln und Signieren: Empfangende Systeme benötigen ein Zertifikat der Verwaltungs-PKI. Dazu findet man hier eine Beschreibung. Aus diesem Zertifikat generieren man dann JSON Web Keys (JWKs). Eine Beschreibung dazu ist auch hier.
DestinationClient erstellen
Man kann einen DestinationClient erstellen mit der Methode CreateDestinationClient(...) der SDK-Klasse ClientFactory:
string clientId = "YOUR CLIENT ID";
string clientSecret = "YOUR CLIENT SECRET";
destinationClient = ClientFactory.CreateDestinationClient(
FitConnectEnvironment.Test,
clientId,
clientSecret,
Logger
);
Parameter der Methode ClientFactory.CreateDestinationClient()
- FitConnectEnvironment
Das Beispiel oben verwendet die UmgebungTestder FIT-Connect-Infrastruktur. - Client-ID, Client-Secret
Das Beispiel enthält Platzhalter für die Werte inclientIdundclientSecret. Hier ist beschrieben, wie man eine Client-ID und ein Client-Secret erhält. - Logger
Wird ein Logger übergeben, dann muss er das InterfaceMicrosoft.Extensions.Logging.ILoggerimplementieren.
Zustellpunkt erstellen
destinationService.CreateDestination(CreateDestinationDto createDestinationDto);
Um einer Destination zu erstellen, verwendet man die Methode .CreateDestination(CreateDestinationDto createDestinationDto) der DestinationClient.
public class CreateDestinationDto
{
/// <summary>
/// Status of the destination.
/// Allowed values: draft, created, active, inactive, decommissioned.
/// </summary>
[JsonProperty("status")]
public DestinationStatus Status { get; set; }
/// <summary>
/// Name of the destination. This is an optional field.
/// Constraints: 0 to 128 characters.
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
/// <summary>
/// Information regarding the contact person of the destination.
/// This must either specify detailed contact information or be null.
/// </summary>
[JsonProperty("contactInformation")]
public ContactInformationDto ContactInformation { get; set; }
/// <summary>
/// Supported services provided by the destination.
/// Each service includes an identifier, supported regions, and submission schemas.
/// </summary>
[JsonProperty("services")]
public HashSet<DestinationServiceDto> Services { get; set; }
/// <summary>
/// Object specifying configuration for callback notifications to the destination.
/// Includes a publicly accessible callback URL and an optional callback secret for HMAC validation.
/// </summary>
[JsonProperty("callback")]
public CallbackDto Callback { get; set; }
/// <summary>
/// Identifier of the encryption key for the destination.
/// Constraints: Max 64 characters. Must match the "kid" of the encryptionPublicKey.
/// </summary>
[JsonProperty("encryptionKid")]
public string EncryptionKid { get; set; }
/// <summary>
/// JSON Web Key (JWK) containing details of the encryption key used by the destination.
/// </summary>
[JsonProperty("encryptionPublicKey")]
public ApiJwk EncryptionPublicKey { get; set; }
/// <summary>
/// JSON Web Key (JWK) containing details of the signing key used by the destination for digital signatures.
/// </summary>
[JsonProperty("signingPublicKey")]
public ApiJwk SigningPublicKey { get; set; }
/// <summary>
/// List of metadata schema versions that the destination supports.
/// Format of each version adheres to Semantic Versioning (e.g., 1.0.0).
/// </summary>
[JsonProperty("metadataVersions")]
public HashSet<string> MetadataVersions { get; set; }
/// <summary>
/// Specifies the supported reply channels for submissions to this destination.
/// If none are specified, it is assumed that the authority only communicates via physical mail for responses.
/// </summary>
[JsonProperty("replyChannels")]
public DestinationReplyChannelsDto ReplyChannels { get; set; }
1. Destination Status - Zustellpunkt-Status
Definiert den aktuellen Status des Zustellpunktes. Mögliche Werte:
-
draft – Im Entwurfsstatus.
-
created – Erstellt, aber noch nicht aktiv.
-
active – Bereits aktiv und im Einsatz.
-
inactive – Deaktiviert, nicht mehr nutzbar.
-
decommissioned – Stillgelegt.
2. Name
Der interne Name des Zustellpunktes.
Constraints:
- Typ: string
- Länge: 0–128 Zeichen
3. Contact Information - Kontaktinformationen
Informationen zur Organisation oder Person, die für den Zustellpunkt verantwortlich ist.
Felder:
-
legalName – Juristischer Name
-
address – Adresse
-
phone – Telefonnummer
-
email – E-Mail-Adresse (gültig)
-
unit – Abteilung (optional)