private KeyPair generateVapidKeys() throws NoSuchProviderException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
  KeyPairGenerator keyPairGenerator=KeyPairGenerator.getInstance("ECDSA","BC");
  keyPairGenerator.initialize(ECNamedCurveTable.getParameterSpec("prime256v1"),new SecureRandom());
  return keyPairGenerator.generateKeyPair();
}

private KeyPair generateVapidKeys ( ) throws NoSuchProviderException , NoSuchAlgorithmException , InvalidAlgorithmParameterException { KeyPairGenerator keyPairGenerator = KeyPairGenerator . getInstance ( "ECDSA" , "BC" ) ; keyPairGenerator . initialize ( ECNamedCurveTable . getParameterSpec ( "prime256v1" ) , new SecureRandom ( ) ) ; return keyPairGenerator . generateKeyPair ( ) ; }
generate a public - private keypair on the prime256v1 curve .
