We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 密钥对生成地址 https://www.lzltool.com/SM2 private static final String PRIVATE_KEY = ""; private static final String PUBLIC_KEY = ""; public static String decryptStr(String cipherTextHex) { try { SM2 sm2 = SmUtil.sm2(PRIVATE_KEY, null); // 只需要私钥 sm2.setMode(SM2Engine.Mode.C1C2C3); // 设置解密模式,JS 加密model 选:0 byte[] decryptedBytes = sm2.decrypt(HexUtil.decodeHex(cipherTextHex), KeyType.PrivateKey); return Base64.decodeStr(StrUtil.utf8Str(decryptedBytes)); // 转换为字符串 }catch (Exception e){ log.error("decryptStr error: ", e); } return null; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: