title: Elliptic Curve with Digital Signature Algorithm (ECDSA) implementation on BouncyCastle
body: <p>I am trying to implement ECDSA (Elliptic Curve Digital Signature Algorithm) but I couldn't find any examples in Java which use Bouncy Castle. I created the keys, but I really don't know what kind of functions I should use to create a signature and verify it.</p>
  
  <pre><code>public static KeyPair GenerateKeys()
      throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException
  {
      ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("B-571");
      KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC");
      g.initialize(ecSpec, new SecureRandom());
      return g.generateKeyPair();
  }
  </code></pre>