0

I'm writing a PEM file parser and would like to be able to parse EC private keys. I'm having trouble assembling all of the pieces of the EllipticCurve object itself. I need to construct all of the following:

  1. The ECField (requires the prime p)
  2. The EllipticCurve (requires an ECField, a, b, and a seed)
  3. The ECParameterSpec (requires the curve, values for G, n, and h)

The values for the p, a, b, G, n, and h should be a part of the definition of the curve. I'm not sure where the seed comes from, honestly.

Anyway, I started with a single curve but it seems that Java ought to have these curve definitions already built somewhere. Is that accessible via the standard API?

Please no answers saying "just use BouncyCastle," I'm specifically trying to avoid external dependencies.

Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
  • [Explanation of each of the parameters used in ECC](https://crypto.stackexchange.com/a/22935/18298) – kelalaka Aug 30 '21 at 22:42
  • Note that, you need this for the [validation of the curve](https://crypto.stackexchange.com/q/89348/18298) and [another](https://crypto.stackexchange.com/a/87711/18298) – kelalaka Aug 30 '21 at 22:59

0 Answers0