Closed SabinLee closed 7 years ago
Hi Sabin,
You can encrypt using public key and decrypt using private key. You can not do the reversed flow, i.e. you can NOT decrypt with public key. The reason for that is the public key is "public", anyone can has the public key, which means anyone can decrypt the data (if allowed). Then there is no point to encrypt the data in the first place.
If you want to have 2-way communication between client and server (for example), you can choose either:
Best regards,
Thanks for your answer! now I understand,and I will Continue studying it
I have a data decoding with base64,it's correct.but I don't know how to decrypt it use RSAUtils,I had a pem file,it contains a public key like "---begin public key---,---end public key---",and how can I use the public key decrypt the encrypted data? 我有一个通过base64解密得到的data,它是正确的.但是我不知道如何使用RSAUtils来解密这个data,我在本地有一个服务器生成的pem文件,里面的内容是类似于"---begin public key---,---end public key---",那么我该怎么用这个公钥解密这个data?注释看起来说的并不详细