Repository navigation
OnixLabs.Security.Cryptography
Matthew Layton edited this page Nov 15, 2026
·
5 revisions
Strongly typed cryptographic primitives and structures with value semantics, designed to make cryptographic operations safer and more explicit.
dotnet add package OnixLabs.Security.Cryptography- Public and private key abstractions (
PublicKey,PrivateKey). - ECDH, ECDSA, EdDSA, and RSA key implementations.
- Digital signature types (
DigitalSignature,DigitalSignatureAndPublicKey). - Cryptographic hash value types (
Hash,NamedHash). - Extensions for
HashAlgorithm. - Fully managed FIPS-202 SHA-3 implementation (SHA3-224/256/384/512, SHAKE128/256).
- Merkle tree implementations (
MerkleTree,MerkleTree<T>). - Cryptographic salt value type (
Salt). - Encrypted-in-memory secret handling (
Secret). - Common cryptographic primitive abstraction (
ICryptoPrimitive).
All types are in the OnixLabs.Security.Cryptography namespace.
| Type | Description |
|---|---|
| Hash | An immutable, algorithm-agnostic hash value with value semantics. |
| NamedHash | A Hash paired with the name of the algorithm that produced it. |
| Sha3 | FIPS-202 SHA-3 HashAlgorithm base class. |
| Sha3Hash224 / Sha3Hash256 / Sha3Hash384 / Sha3Hash512 | Fixed-length SHA-3 hash algorithms. |
| Sha3Shake128 / Sha3Shake256 | SHAKE extendable-output functions. |
| MerkleTree | An immutable Merkle tree of Hash values. |
| MerkleTree<T> | A Merkle tree that retains its typed leaf values. |
| Type | Description |
|---|---|
| PrivateKey | Abstract base for asymmetric private keys (encrypted in memory, disposable). |
| PublicKey | Abstract base for asymmetric public keys. |
| NamedPrivateKey / NamedPublicKey | A key paired with its algorithm name. |
| EcdhPrivateKey / EcdhPublicKey | Elliptic Curve Diffie-Hellman key-agreement keys. |
| EcdsaPrivateKey / EcdsaPublicKey | Elliptic Curve Digital Signature Algorithm keys. |
| EddsaPrivateKey / EddsaPublicKey | Edwards-curve Digital Signature Algorithm keys. |
| RsaPrivateKey / RsaPublicKey | RSA signing keys. |
| Type | Description |
|---|---|
| DigitalSignature | An immutable digital signature value. |
| DigitalSignatureAndPublicKey | A digital signature paired with its public key. |
| Salt | A cryptographic salt value backed by random bytes. |
| Secret | An encrypted-in-memory, disposable secret value. |
| Type | Description |
|---|---|
| ICryptoPrimitive<T> | Base contract for cryptographic primitives (value equality + binary conversion). |
| IHashable | Defines computing the Hash of an object. |
| Type | Description |
|---|---|
| IEcdhPrivateKey | ECDH private-key operations (shared-secret derivation). |
| IEcdsaPrivateKey | ECDSA private-key signing operations. |
| IEddsaPrivateKey | EdDSA private-key signing operations. |
| IRsaPrivateKey | RSA private-key signing operations. |
| IPrivateKeyDerivable<T> | Derives the corresponding public key. |
| IPrivateKeyExportable | Aggregate private-key export contract. |
| IPrivateKeyImportable<T> | Aggregate private-key import contract. |
| IPrivateKeyPemImportable<T> | PEM (RFC 7468) private-key import. |
| IPrivateKeyPkcs8Exportable | PKCS #8 private-key export. |
| IPrivateKeyPkcs8Importable<T> | PKCS #8 private-key import. |
| IPrivateKeyPkcs8PemExportable | PKCS #8 PEM private-key export. |
| IPrivateKeyRawExportable | Raw-bytes private-key export. |
| IPrivateKeyRawImportable<T> | Raw-bytes private-key import. |
| IPrivateKeyRawPemExportable | Raw PEM private-key export. |
| Type | Description |
|---|---|
| IEcdhPublicKey | ECDH public-key marker. |
| IEcdsaPublicKey | ECDSA public-key verification operations. |
| IEddsaPublicKey | EdDSA public-key verification operations. |
| IRsaPublicKey | RSA public-key verification operations. |
| IPublicKeyExportable | Aggregate public-key export contract. |
| IPublicKeyImportable<T> | Aggregate public-key import contract. |
| IPublicKeyPemExportable | PEM (RFC 7468) public-key export. |
| IPublicKeyPemImportable<T> | PEM public-key import. |
| IPublicKeyRawExportable | Raw-bytes public-key export. |
| IPublicKeyRawImportable<T> | Raw-bytes public-key import. |
| Type | Description |
|---|---|
| HashAlgorithmExtensions |
HashAlgorithm extensions that compute a Hash. |
| ReadOnlySpanExtensions |
ReadOnlySpan<byte> extensions (ToHash, ToSecret). |
| Item | Supported |
|---|---|
| Target frameworks | .NET 8.0, .NET 9.0, .NET 10.0, .NET 11.0 |
| Language version | C# 15 |
| License | Apache-2.0 |
Pkcs8PrivateKeyInfo is not part of the shared framework on any target, so each target framework references System.Security.Cryptography.Pkcs from its own runtime's servicing line.
| Package | .NET 8.0 | .NET 9.0 | .NET 10.0 | .NET 11.0 |
|---|---|---|---|---|
| OnixLabs.Core | Same version | Same version | Same version | Same version |
System.Security.Cryptography.Pkcs |
8.0.2 | 9.0.23 | 10.0.15 | 11.0.0 |
ONIXLabs .NET Library · Repository · NuGet · License (Apache-2.0)
Copyright © ONIXLabs 2020. Licensed under the Apache License, Version 2.0.
- Enumeration<T>
- Optional<T>
- OptionalEqualityComparer<T>
- OptionalExtensions
- Result
- Result<T>
- ResultEqualityComparer<T>
- ResultExtensions
- Specification<T>
- Preconditions
- IValueEquatable<T>
- IValueComparable<T>
- IBinaryConvertible
- ISpanBinaryConvertible
- IMemoryBinaryConvertible
- ArrayExtensions
- ComparableExtensions
- DateTimeExtensions
- ISpanParsableExtensions
- ObjectExtensions
- RandomExtensions
- ReadOnlySequenceExtensions
- ReadOnlySpanExtensions
- StringExtensions
- Base16
- Base32
- Base58
- Base64
- IBaseCodec
- IBaseValue
- IBaseValue<T>
- Base16Codec
- Base32Codec
- Base58Codec
- Base64Codec
- Base16FormatProvider
- Base32FormatProvider
- Base58FormatProvider
- Base64FormatProvider
- EncodingExtensions
- ReadOnlySpanExtensions
- StringBuilderExtensions
- BigDecimal
- BigDecimalEqualityComparer
- BigDecimalOrdinalityComparer
- NumberInfo
- NumberInfoEqualityComparer
- NumberInfoOrdinalityComparer
- Int256
- Int512
- UInt256
- UInt512
- Float128
- Float256
- GenericMath
- NumericsExtensions
- ConversionMode
- ScaleMode
- Hash
- NamedHash
- Sha3
- Sha3Hash224
- Sha3Hash256
- Sha3Hash384
- Sha3Hash512
- Sha3Shake128
- Sha3Shake256
- MerkleTree
- MerkleTree<T>
- PrivateKey
- PublicKey
- NamedPrivateKey
- NamedPublicKey
- EcdhPrivateKey
- EcdhPublicKey
- EcdsaPrivateKey
- EcdsaPublicKey
- EddsaPrivateKey
- EddsaPublicKey
- RsaPrivateKey
- RsaPublicKey
- DigitalSignature
- DigitalSignatureAndPublicKey
- Salt
- Secret
- ICryptoPrimitive<T>
- IHashable
- IEcdhPrivateKey
- IEcdsaPrivateKey
- IEddsaPrivateKey
- IRsaPrivateKey
- IPrivateKeyDerivable<T>
- IPrivateKeyExportable
- IPrivateKeyImportable<T>
- IPrivateKeyPemImportable<T>
- IPrivateKeyPkcs8Exportable
- IPrivateKeyPkcs8Importable<T>
- IPrivateKeyPkcs8PemExportable
- IPrivateKeyRawExportable
- IPrivateKeyRawImportable<T>
- IPrivateKeyRawPemExportable
- IEcdhPublicKey
- IEcdsaPublicKey
- IEddsaPublicKey
- IRsaPublicKey
- IPublicKeyExportable
- IPublicKeyImportable<T>
- IPublicKeyPemExportable
- IPublicKeyPemImportable<T>
- IPublicKeyRawExportable
- IPublicKeyRawImportable<T>
- HashAlgorithmExtensions
- ReadOnlySpanExtensions