如何从 byte[] 数组中恢复 RSA 公钥?

2022-01-10 00:00:00 cryptography rsa java

我想知道是否可以恢复我之前转换为字节数组的 RSA 公钥.

I'm wondering if it's possible to recover a RSA public key that I have converted to byte array previously.

byte[] keyBytes = publicKey.getEncoded();

感谢您的帮助.

推荐答案

PublicKey publicKey = 
    KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(bytes));

有关详细信息请参阅本教程

相关文章