小程序安全键盘&SM2解密方式
转载请著名出处:https://cloud.tencent.com/developer/article/2343188
SM2基本信息
- 私钥(primary key)
6082011f17b21dab7da93f2dc1a739b530b969171c7116bebb0535a953e20bae
- 公钥(public key)
041708d05635b28264a919b89b1370b1517e51d19851c93b49bbaa54521ca4fec0d384069374dcedd846abb55b9920cc4fdf2270b4283b30de55344a66cb3f4334
- 加密内容
hellonyouthn12334
- 需要的加密库(java)
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.67</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.67</version>
</dependency>
理论上版本越高越好,如果版本较低可能出现加解密问题,这点是要注意的~
- 三方实现库(gmhelper)
https://github.com/ZZMarquis/gmhelper