使用RSA公钥加密 - EncryptWithRsa
函数简介
- 使用RSA公钥对数据进行加密。
接口名称
EncryptWithRsa
DLL调用
long EncryptWithRsa(long instance, string message, string publicKey, int paddingType)
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数 | OLAPlug实例指针,由 CreateCOLAPlugInterFace 接口生成。 |
| message | 字符串 | 要加密的明文。 |
| publicKey | 字符串 | RSA公钥。 |
| paddingType | 整数 | 填充类型:0-PKCS1;1-OAEP。 |
示例
// 示例代码待补充
返回值
成功返回加密后的密文字符串的指针;失败返回0。
注意事项
- 返回的字符串指针需要调用 FreeStringPtr 接口释放内存。
