Java Key Pair Create generateKeyPair()

Here you can find the source of generateKeyPair()

Description

generate Key Pair

License

Open Source License

Declaration

public static KeyPair generateKeyPair() throws Exception 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.SecureRandom;

public class Main {
    public static KeyPair generateKeyPair() throws Exception {
        KeyPairGenerator kpGen = KeyPairGenerator.getInstance("RSA", "BC");

        kpGen.initialize(1024, new SecureRandom());

        return kpGen.generateKeyPair();
    }/*w  w w . j  a va  2s . co  m*/
}

Related

  1. generateKeyPair()
  2. generateKeyPair()
  3. generateKeyPair()
  4. generateKeyPair()
  5. generateKeyPair()
  6. generateKeyPair()
  7. generateKeyPair()
  8. generateKeyPair()
  9. generateKeyPair()