question: protected KeyPair generateKeyPair ( ) { KeyPair keyPair = null ; DHParameterSpec keySpec = new DHParameterSpec ( DH_MODULUS , DH_BASE ) ; try { KeyPairGenerator keyGen = KeyPairGenerator . getInstance ( "DH" ) ; keyGen . initialize ( keySpec ) ; keyPair = keyGen . generateKeyPair ( ) ; keyAgreement = KeyAgreement . getInstance ( "DH" ) ; keyAgreement . init ( keyPair . getPrivate ( ) ) ; } catch ( Exception e ) { log . error ( "Error generating keypair" , e ) ; } return keyPair ; }
target:  Creates a Diffie-Hellman key pair.