Here you can find the source of generateKeyPair(final String algorithmModePad, final int keySize)
Parameter | Description |
---|---|
algorithmModePad | a parameter |
keySize | a parameter |
public static KeyPair generateKeyPair(final String algorithmModePad, final int keySize)
//package com.java2s; //License from project: Apache License import java.security.*; public class Main { /**/* www . jav a 2 s.com*/ * Generate KeyPair * @param algorithmModePad * @param keySize * @return */ public static KeyPair generateKeyPair(final String algorithmModePad, final int keySize) { KeyPair keyPair = null; try { final KeyPairGenerator keyGen = KeyPairGenerator.getInstance(algorithmModePad); keyGen.initialize(keySize); keyPair = keyGen.generateKeyPair(); } catch (Exception e) { e.printStackTrace(); } return keyPair; } }