public KeyPair generateKeyPair ( ) throws NoSuchAlgorithmException { LOGGER . info ( "Generating new key pair" ) ; final KeyPairGenerator keyGen = KeyPairGenerator . getInstance ( "RSA" ) ; final SecureRandom random = SecureRandom . getInstance ( "SHA1PRNG" ) ; keyGen . initialize ( 4096 , random ) ; return this . keyPair = keyGen . generateKeyPair ( ) ; }
Generates a key pair .