HAKOM.Cryptography.Core.Net Assembly
Provides the core cryptography services for the HAKOM platform, including RSA encryption, decryption, signing, and signature verification backed by pluggable certificate stores.
Remarks
Section titled “Remarks”This assembly contains the ICryptographyService abstraction, certificate store infrastructure (ICertificateStore, ICertificateStoreFactory), and two built-in store implementations: a file-system PFX store and a Windows Local User certificate store.
Registration is performed through the extension methods in ContainerExtensions:
IApplicationContext.Create(container =>{ container .UseDefaultCryptographyService() .UseDefaultCryptographyFactories() .UseLocalUserCertificates() .UseFileSystemCertificates();});The ICryptographyService interface provides both synchronous overloads that accept a raw System.Security.Cryptography.X509Certificates.X509Certificate2 and asynchronous overloads that resolve the certificate by name from the configured stores.
string cipherText = await cryptographyService.EncryptBase64(clearBytes, "Default");byte[] decrypted = await cryptographyService.DecryptBase64(cipherText, "Default");| Namespaces | |
|---|---|
| HAKOM.Cryptography.Core.Net.Api | Contains the public API surface for HAKOM cryptography services, including the primary ICryptographyService interface, ICertificateStore abstraction, and ICertificateStoreFactory for creating store instances. |
| HAKOM.Cryptography.Core.Net.Api.CertificateStores.Exceptions | Contains exceptions thrown by ICertificateStore implementations when certificate names conflict, are missing from the configuration, or store-level operations fail. |
| HAKOM.Cryptography.Core.Net.Api.CertificateStores.FileSystem | Contains the public API for the file-system-based PFX certificate store, including the IPfxSettingsProvider interface for obtaining filenames and passwords. |
| HAKOM.Cryptography.Core.Net.Api.CertificateStores.FileSystem.Exceptions | Contains exceptions specific to the file-system PFX certificate store, such as missing certificate files, filename collisions, exhausted root path alternatives, and invalid or password-protected certificates. |
| HAKOM.Cryptography.Core.Net.Api.CertificateStores.LocalUser.Exceptions | Contains exceptions specific to the Windows Local User certificate store. |
| HAKOM.Cryptography.Core.Net.Api.Exceptions | Contains exceptions related to certificate lookup and RSA key validation in the ICryptographyService. |
| HAKOM.Cryptography.Core.Net.Api.Exceptions.InvalidRsaCertificateExceptions | Contains concrete InvalidRsaCertificateException subtypes that indicate specific missing RSA keys on a certificate. |
| HAKOM.Cryptography.Core.Net.Api.Extensions | Provides extension methods for dependency injection registration of cryptography services and for decrypting configuration values. |
Was this page helpful?Thanks for your feedback!