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 NoSuchAlgorithmException 

Method Source Code


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

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

public class Main {
    public static KeyPair generateKeyPair() throws NoSuchAlgorithmException {
        final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC");
        final SecureRandom random = SecureRandom.getInstance("SHA1PRNG");

        keyPairGenerator.initialize(256, random);

        final KeyPair keyPair = keyPairGenerator.generateKeyPair();
        return keyPair;
    }/*www .  j a  va2s  .  com*/
}

Related

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