Encrypting with RSA private key in Java

后端 未结 5 659
误落风尘
误落风尘 2020-12-08 17:39

I\'m trying to encrypt some content with an RSA private key.

I\'m following this example: http://www.junkheap.net/content/public_key_encryption_java

but c

5条回答
  •  借酒劲吻你
    2020-12-08 18:12

    Its not an accident that encryption with private key is allowed. If you want to break a signature into individual hashing and encryption, then encrypting with private key is essential. Lets say I have a document which i need to sign and my key resides on a network HSM. Now either I stream the entire document to the HSM to sign or I can create a local hash and stream it to the HSM for encryption alone. My choice will depend on whether the local hash computation gives me better performance viz a viz delegated hash computation with network latency.

提交回复
热议问题