Skip to content

Decode private key doesn't work. #13

Description

@digitalhuman

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions