Giter VIP home page Giter VIP logo

pkcsextensions's Introduction

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

pkcsextensions's People

Contributors

harrison314 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

pkcsextensions's Issues

Parse subject and issuer

Add extension method for X509Certificate2 to parse subject and issuer to OID and X509EntryName.

Add

Add [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] for class is not supported in current WASM runtimne.

See dotnet/runtime#40074.

Add X509Certificate Extension

Add extensions for X509Certificate2:

IReadonlyList<string> GetNameInfo(string nameTypeOid, bool forIssuer );
IReadonlyList<string> GetNameInfo(string nameTypeOid, X509NameSource nameSource);
// enum X509NameSource { Subject, Issuer }

Get values from subject and issuer name.

Add method to read key and certificate file

Add method for read key and certificate from file/memory - in DER or PEM format.

eg: X509Certificate2 Load(byte[] certificateContent, byte[] keyContent) - returns certificate with private key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.