Java Cryptography, Java, Java Interview, Rsa Algorithm, Aes Algorithm.
Base64.getEncoder().encodeToString(publicKey.getEncoded()); } public static void main(String[] args) throws Exception { KeyPair keyPair = RSAKeyPairGenerator.generateKeyPair(); PublicKey publicKey = keyPair.getPublic(); // Convert public key to string String publicKeyString =