title: Is there a difference between ECDH and ECDSA keys?
body: <p>I'm building a network application that uses BouncyCastle as a cryptography provider.  Let's say you have this to generate a keypair:</p>
  
  <pre><code>ECParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("prime192v1");
  KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC");
  g.initialize(ecSpec, new SecureRandom());
  KeyPair pair = g.generateKeyPair();
  </code></pre>
  
  <p>I'm confused as to why you're getting an instance of an <em>ECDSA</em> KeyPairGenerator.  Why doesn't it just say <em>EC</em>?  I know that there's an ECDH Key type that is shipped with BouncyCastle, but I thought that the two represented the same stuff about the points on the curve --  or am I completely wrong with the theory behind it?</p>
  
  <p>The reason that I ask is that right now my application uses ECDH fine to establish an AES secret key, but now I want to use the same EC key to sign each message using ECDSA.</p>