-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add support for encrypted rsa private key #1
Comments
hi @StefH How is it going? |
Sorry I don't have the knowledge to continue on this issue. |
@StefH I found a solution can encrypt data with private key , http:https://www.bouncycastle.org/csharp/ Here is the code, you can try. public static byte[] RSAPrivateEncrypt(System.Security.Cryptography.RSA priRsa, byte[] byteData)
{
var keyPair = DotNetUtilities.GetKeyPair(priRsa);
var c = CipherUtilities.GetCipher("RSA/ECB/PKCS1Padding");
c.Init(true, keyPair.Private); //init with private key
var encryptedBytes = c.DoFinal(temp); //encrypt data with private key
return encryptedBytes;
} |
@oudi it is not the issue of how to encrypt data with the privatekey - but that the privatekey itself is encrypted. |
Correct. What I want to build is that you can provide an encrypted private key in the For that to work I
@nmbro Do you more details, and can you maybe create a PR? |
No description provided.
The text was updated successfully, but these errors were encountered: