是否可以使用.net RSACryptoServiceProvider 使用私钥加密?

3

本文介绍了是否可以使用.net RSACryptoServiceProvider 使用私钥加密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我知道 RSACryptoServiceProvider 可以用公钥加密,然后可以用私钥解密.

I know that RSACryptoServiceProvider can encrypt with the public key, then it can be decrypted with the private key.

是否可以使用 RSACryptoServiceProvider 使用私钥加密并使用公钥解密?

Is it possible to encrypt with the private key and decrypt with the public key using the RSACryptoServiceProvider ?

推荐答案

没有.这不是任何公钥/私钥加密的工作方式.只能用公钥加密,只能用私钥解密.

No. That's not how any public/private key encryption works. You can only encrypt with the public key, and only decrypt with the private key.

如果您想将私钥应用于消息,也许您正在寻找 签名,而不是加密?这是一种不同的加密方案,也可以使用 RSA 密钥.

If you want to apply the private key to a message, maybe you're looking for a signature, rather than encryption? This is a different cryptographic scheme that can also use RSA keys.

这篇关于是否可以使用.net RSACryptoServiceProvider 使用私钥加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

C# 中的多播委托奇怪行为?
Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)...
2023-11-11 C#/.NET开发问题
6

如何将代表存储在列表中
How to store delegates in a List(如何将代表存储在列表中)...
2023-11-11 C#/.NET开发问题
6

代表如何工作(在后台)?
How delegates work (in the background)?(代表如何工作(在后台)?)...
2023-11-11 C#/.NET开发问题
5

Delegate.CreateDelegate() 和泛型:错误绑定到目标方法
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)...
2023-11-11 C#/.NET开发问题
14

函数委托与函数
Func Delegate vs Function(函数委托与函数)...
2023-11-11 C#/.NET开发问题
6

具有未知类型的 CreateDelegate
CreateDelegate with unknown types(具有未知类型的 CreateDelegate)...
2023-11-11 C#/.NET开发问题
5