PKCS11加密与RSA私钥的哈希
我们正在建立一个数字签名平台。 根据用户,我们在HSM中生成RSA 2048密钥对,并发布X509数字证书。 在底线或凯德(Cades)数字签名(包裹)期间,我们获得了SHA256 HASH 32字节,需要使用用户的RSA私钥加密,以完成签名操作。
我们应该使用哪些PKCS11机制和功能使用RSA私钥加密HASH?
似乎使用C_SIGN()将CKM_SHA256_RSA_PKCS使用hash,然后签名/加密它。这不是我们想要的 - 除非我误会了。
这项工作是否可以:c_encrypt(ckm_rsa_pkcs,privateKeyhandle,hashbytes)?根据文档,ckm_rsa_pkcs使用公共密钥。
非常感谢
We are building a Digitial Signing platform.
Per user we generate a RSA 2048 key pair in an HSM, and issue a X509 digital certificate.
During PAdEs or CAdES digital signing (Enveloping) we get the SHa256 hash 32 bytes that needs to be encrypted with user's RSA private key in order to complete signing operation.
What PKCS11 mechanism and function should we use to encrypt a hash with RSA private key?
It seems using CKM_SHA256_RSA_PKCS with C_Sign() will hash the hash and then sign/encrypt it. which is not what we want - unless i am mistaken.
Would this work: C_Encrypt(CKM_RSA_PKCS, privateKeyHandle, hashBytes)? according to documentation CKM_RSA_PKCS uses public key.
Many Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。方法是您需要的。
在
参数Mechansim是通过以下方式进行的:
这是RSA Mechansim。为了设置其长度,您应该创建一个具有2048模量长度的私钥。
是您需要的吗?
Yes. the method Sign is what you need.
In PKCS11Interop GitHub project page, there is an example named '_20_signAndVerifyTest.cs' in which uses a method with this signature:
The argument mechansim is made through:
which is a RSA mechansim. for setting its length, you should create a private key with 2048 modulus length.
is it what you need?