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.*;

public class Main {
    private static KeyPairGenerator generator;

    public static KeyPair generateKeyPair() throws Exception {
        if (generator == null) {
            generator = KeyPairGenerator.getInstance("RSA");
        }/* w w w. ja  va  2s . c om*/
        generator.initialize(2048);
        return generator.genKeyPair();
    }
}

Related

  1. generateKeyFromString(final String secKey, String algorithm)
  2. generateKeyPair()
  3. generateKeyPair()
  4. generateKeyPair()
  5. generateKeyPair()
  6. generateKeyPair()
  7. generateKeyPair()
  8. generateKeyPair()
  9. generateKeyPair()