Asymmetric Key Maker : KeyPairGenerator « Security « Java Tutorial






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());

  }
}








36.22.KeyPairGenerator
36.22.1.Creating a Certification Request
36.22.2.Adding Extensions to a Certification Request
36.22.3.Creating a Certificate from a Certification Request
36.22.4.Asymmetric Key Maker
36.22.5.Getting the Bytes of a Generated Key Pair
36.22.6.The bytes can be converted back to public and private key objects
36.22.7.Generating a Public/Private Key Pair
36.22.8.Generate a 576-bit DH key pair