点击或拖拽改变大小

RSAHelper 类

RSA加密解密算法的辅助方法,可以用PEM格式的密钥创建公钥,或是私钥对象,然后用来加解密操作。
继承层次
SystemObject
  HslCommunication.Core.SecurityRSAHelper

命名空间:  HslCommunication.Core.Security
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:12.0.0.0 (12.0.0.0)
语法
public class RSAHelper

RSAHelper 类型公开以下成员。

构造函数
  名称说明
公共方法RSAHelper
初始化 RSAHelper 类的一个新实例
Top
方法
  名称说明
公共方法静态成员CreateRsaProviderFromPrivateKey(Byte)
使用原始的私钥数据(PEM格式)来创建一个 RSA 算法加密解密的对象,可以直接用于加密解密操作
Use the original private key data (PEM format) to create an RSA algorithm encryption and decryption object, which can be directly used for encryption and decryption operations
公共方法静态成员CreateRsaProviderFromPrivateKey(String)
使用 PEM 格式基于base64编码的私钥来创建一个 RSA 算法加密解密的对象,可以直接用于加密解密操作
Use the PEM format based on the base64-encoded private key to create an RSA algorithm encryption and decryption object, which can be directly used for encryption and decryption operations
公共方法静态成员CreateRsaProviderFromPublicKey(Byte)
使用原始的公钥数据(PEM格式)来创建一个 RSA 算法加密解密的对象,可以直接用于加密或是验证签名操作
Use the original public key data (PEM format) to create an RSA algorithm encryption and decryption object, which can be directly used for encryption or signature verification
公共方法静态成员CreateRsaProviderFromPublicKey(String)
PEM 格式基于base64编码的公钥来创建一个 RSA 算法加密解密的对象,可以直接用于加密或是验证签名操作
Use the original public key data (PEM format) to create an RSA algorithm encryption and decryption object, which can be directly used for encryption or signature verification
公共方法静态成员DecryptLargeDataByRSA
对超过117字节限制的加密数据进行解密,解密出原始的字节数据,因为RSA本身限制了117字节,所以此处进行数据切割解密。
Decrypt the encrypted data that exceeds the 117-byte limit and decrypt the original byte data, because RSA itself limits 117 bytes, so the data is cut and decrypted here.
公共方法静态成员EncryptLargeDataByRSA
对原始字节的数据进行加密,不限制长度,因为RSA本身限制了117字节,所以此处进行数据切割加密。
Encrypt the original byte data without limiting the length, because RSA itself limits 117 bytes, so the data is cut and encrypted here.
公共方法Equals (继承自 Object。)
受保护的方法Finalize (继承自 Object。)
公共方法GetHashCode (继承自 Object。)
公共方法静态成员GetPrivateKeyFromRSA
从RSA的算法对象里,获取到PEM格式的原始私钥数据,如果需要存储,或是显示,只需要 Convert.ToBase64String 方法
Obtain the original private key data in PEM format from the RSA algorithm object. If you need to store or display it, you only need the Convert.ToBase64String method
公共方法静态成员GetPublicKeyFromRSA
从RSA的算法对象里,获取到PEM格式的原始公钥数据,如果需要存储,或是显示,只需要 Convert.ToBase64String 方法
Obtain the original public key data in PEM format from the RSA algorithm object. If you need to store or display it, you only need the Convert.ToBase64String method
公共方法GetType (继承自 Object。)
受保护的方法MemberwiseClone (继承自 Object。)
公共方法ToString (继承自 Object。)
Top
扩展方法
  名称说明
公共扩展器方法ToJsonString
获取当前对象的JSON格式表示的字符串。
Gets the string represented by the JSON format of the current object.
(由 HslExtension 定义。)
Top
参见