Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode private key doesn't work. #13

Open
digitalhuman opened this issue Sep 7, 2019 · 3 comments
Open

Decode private key doesn't work. #13

digitalhuman opened this issue Sep 7, 2019 · 3 comments

Comments

@digitalhuman
Copy link

Below code generates Exception thrown: 'System.Security.Cryptography.CryptographicException' in mscorlib.dll.
I am using .NET 4.6.1 with 4096 bits RSA private key

string pkey = File.ReadAllText(@"C:\Temp\private.key");
            IOpenSSLPrivateKeyDecoder privateKeyDecode = new OpenSSLPrivateKeyDecoder();
            var rsa = privateKeyDecode.DecodeParameters(pkey);
            RSACryptoServiceProvider provider = new RSACryptoServiceProvider();
            provider.ImportParameters(rsa);
@digitalhuman
Copy link
Author

digitalhuman commented Sep 7, 2019

Im only using OpenSSL.PrivateKeyDecode.dll. Could that be the issue?

@ashikiqbal
Copy link

Getting error here: Specified method is not supported.

@StefH
Copy link
Owner

StefH commented May 12, 2020

@digitalhuman and @ashikiqbal can you provide a full working example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants