import java.security.KeyPair; import java.security.KeyPairGenerator; public class Main { public static void main(String[] args) throws Exception { String algorithm = ""; KeyPair keyPair = KeyPairGenerator.getInstance(algorithm).generateKeyPair(); System.out.println(keyPair.getPublic()); System.out.println(keyPair.getPrivate()); } }