GithubHelp home page GithubHelp logo

Default private ECC key generated via step is not compatible with .net framework. Giving unsupported PrivateKey exception of type 'System.NotSupportedException' about cli HOT 4 OPEN

neetabisht avatar neetabisht commented on May 26, 2024
Default private ECC key generated via step is not compatible with .net framework. Giving unsupported PrivateKey exception of type 'System.NotSupportedException'

from cli.

Comments (4)

hslatman avatar hslatman commented on May 26, 2024

How are you using the EC key? Have you tried RSA too, and confirmed that's working? Do you have some example code of how you're trying to use it?

from cli.

neetabisht avatar neetabisht commented on May 26, 2024

Regarding ECC key:
public static async Task connect_with_pub()
{
string x509_pem = @"C:\Users\INNEBIS1/client1-authn-ID.pem";
string x509_key = @"C:\Users\INNEBIS1/client1-authn-ID.key";

    // Load certificate and private key from PEM files
    var certificate = new X509Certificate2(X509Certificate2.CreateFromPemFile(x509_pem, x509_key).Export(X509ContentType.Pkcs12));

Here when I try to extract the values inside certificate then i see
image

Regarding RSA: I tried creating pem and key file using below command and tried checking the values of certificate there I am not seeing any issue.
step certificate create client1-authn-ID client1-authn-ID.pem client1-authn-ID.key --ca ../.step/certs/intermediate_ca.crt
--ca-key ../.step/secrets/intermediate_ca_key --no-password --insecure --not-after 2400h --kty RSA --size 2048

image

So eventually i am not seeing any error when creating cert files using RSA algo but facing issue when "step" default create the cert file with ECC with .net framework.

from cli.

hslatman avatar hslatman commented on May 26, 2024

According to this StackOverflow thread, new X509Certificate2 doesn't support EC: https://stackoverflow.com/questions/45107057/creating-x509certificate2-from-ecc-x509certificate-throws-system-notsupportedex.

This blog has some alternatives: https://www.scottbrady91.com/c-sharp/ecdsa-key-loading.

from cli.

Related Issues (20)

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.