C#.NET BC BouncyCastle 国密 SM2 解密遇到 Invalid point encoding 77
参考:https://blog.csdn.net/seeyouagen/article/details/115727307?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-115727307-blog-122319132.pc_relevant_multi_platform_whitelistv1&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-115727307-blog-122319132.pc_relevant_multi_platform_whitelistv1&utm_relevant_index=1
使用BC 库解密时,如果密文不是 04 开头,前面要加 04. 否则会报 Invalid point encoding 77
if (!encryptedHexStr.StartsWith("04")) { encryptedHexStr = "04" + encryptedHexStr; }
encryptedHexStr 是16 进制字符串。