Path: redb-route/demo/SerialNumbersDemo/SerialNumbers.Core/Services/As2Certificates.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/demo/SerialNumbersDemo/SerialNumbers.Core/Services/As2Certificates.cs ---- using System.Security.Cryptography.X509Certificates; namespace SerialNumbers.Core.Services; /// /// AS2 key material from a directory: hub.pfx is the hub's own certificate with its private /// key (signs what we send, decrypts what we receive), {partner}.cer is each partner's /// public certificate (encrypts what we send, verifies what we receive). /// public static class As2Certificates { public static X509Certificate2 LoadHub(string directory, string password) => X509CertificateLoader.LoadPkcs12FromFile( Path.Combine(directory, "hub.pfx"), password, X509KeyStorageFlags.Exportable); public static X509Certificate2 LoadPartner(string directory, string partnerCode) => X509CertificateLoader.LoadCertificateFromFile(Path.Combine(directory, $"{partnerCode}.cer")); }