class ECDSAKeyGenerator implements KeyGenerator<ECDSAKey> {

  public PrivateKey createPrivateKey(final BigInteger d) throws Exception {
    final KeyFactory factory = KeyFactory.getInstance(KEY_ALGORITHM);
    final ECPrivateKeySpec spec = new ECPrivateKeySpec(d, ecSpec);
    return factory.generatePrivate(spec);
  }

}