RSA使用充气城堡与密钥存储在CSP博客中

时间:2022-01-23 18:30:41

I have a private key in a csp format. I need migrate to Bouncy Castle. But I don't find any function to import this format.

我有一个csp格式的私钥。我需要迁移到Bouncy Castle。但我没有找到任何导入此格式的功能。

Please, can you help me to traslate this code?

拜托,你能帮我翻译一下这段代码吗?

using (RSACryptoServiceProvider privatekey = new RSACryptoServiceProvider()) {
    privatekey.ImportCspBlob("chave em csp");
    Byte[] buffer = Encoding.GetEncoding("utf-8").GetBytes(textEdit1.Text);
    Byte[] signature = privatekey.SignData(buffer, "SHA1");
    return Convert.ToBase64String(signature);
}

Thanks

谢谢

1 个解决方案

#1


0  

You can start with this: C# Sign Data with RSA using BouncyCastle, it tells how to sign using Bouncy Castle, to import the key to Bouncy Castle, you need to look at the DotNetUtilities class on Org.BouncyCastle.Security namespace.

您可以从这开始:C#使用BouncyCastle使用RSA签署数据,它告诉如何使用Bouncy Castle进行签名,将密钥导入Bouncy Castle,您需要查看Org.BouncyCastle.Security命名空间中的DotNetUtilities类。

#1


0  

You can start with this: C# Sign Data with RSA using BouncyCastle, it tells how to sign using Bouncy Castle, to import the key to Bouncy Castle, you need to look at the DotNetUtilities class on Org.BouncyCastle.Security namespace.

您可以从这开始:C#使用BouncyCastle使用RSA签署数据,它告诉如何使用Bouncy Castle进行签名,将密钥导入Bouncy Castle,您需要查看Org.BouncyCastle.Security命名空间中的DotNetUtilities类。