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:
- The
ECField
(requires the prime p) - The
EllipticCurve
(requires anECField
, a, b, and a seed) - 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.