Skip to content

harrison314/PkcsExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PKCS Extensions

NuGet Status

PKCS extensions for .Net Standard, .Net Core and Blazor BCL without external dependencies.

Code is focused for AOT compilation and IL linking (small library, avoid reflection, minimalize internal code dependencies). Cryptography in Blazor WebAssembly is not supported in versions: 5.0, 6.0.

Usage

Install package dotnet add package PkcsExtensions.

Features

  • Namespace PkcsExtensions:
    • ECDsaExtensions - export keys to DER/PEM format on ECDsa.
    • HashAlgorithmConvertor - convert HashAlgorithmName to OID, implementation,...
    • HexConvertor - convert from/to hexadecimal.
    • PemFormater - helper class to convert DER to PEM and back.
    • RSAExtensions - export keys to DER/PEM format on RSA.
    • SecureStringHelper - safe provide SecureString to byte array.
  • Namespace PkcsExtensions.Algorithms:
    • DigestRandomGenerator - Secure random generator based on hash algorithm (inspired from Bauncy Castle). Is helpful for password generation and entropy collection.
    • HashAlgorithmExtensions - More friendly extensions for HashAlgorithm types.
    • RngRandomGenerator - wrapper to RandomNumberGenerator
    • SP800_108 - Standard KDF function in counter mode (inspired from Inferno library).
  • Namespace PkcsExtensions.ASN1 - ASN.1 writer and reader from Microsoft corefx repository.
  • Namespace PkcsExtensions.Pkcs1:
    • Pkcs1DigestInfo - Is helpful for RSA signing using SmartCards through PKCS#11.
    • ECDsaSigValue - Encode ECDsa-Sig-Value (RFC5480).
  • Namespace PkcsExtensions.Pkcs7 - Missing features for SignedCms.
  • Namespace PkcsExtensions.X509Certificates:
    • X509Certificate2Extensions - X509Certificate2 extensions for determine the usage of certificate.
    • X509Certificate2EncodeExtensions - encode (DER/PEM) extension for X509Certificate2.
    • X509Certificate2NameInfoExtensions - X509Certificate2 extensions for extract values by OID from isser and subject name - method GetNameInfo.

Examples

See code examples in test project.

Inspire from