RSA 公钥转换问题
程序代码:
String key = "30818702818100B7DB6163C5FBF7D6884AC606710AD70861E06542AB716AB4E92178614178A623A0A7279C4C69FB4926132A1D3C5E1FD3DC363A9413C5A139DC9CBFAF76E9B52DA38282F677171CE06AF7722F6C5CD9DF20AB13A7D59C7615A497949991496A0DAA80C6A3CB59A5F9EFF4B4F68C0C7923EA29F2C560989AC8FE87EFB0085461A5020103"; // full key omitted for brevity byte[] derPublicKey = DatatypeConverter.parseHexBinary(key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(derPublicKey); PublicKey jjj =keyFactory.generatePublic(publicKeySpec);
key是别人提供的,想转换成 PublicKey 类型 最后那一步报错 java.security.InvalidKeyException: IOException: algid parse error, not a sequence
请问大家谁遇到过,指点一下