Everything needed for a key pair is now on the table. A private key is a randomly chosen integer d between 1 and n − 1, where n is the number of points on the curve. A public key is the point Q = dG, where G is a generator that everyone using that curve shares and that is published in the standard.
That is the whole of key generation. One random number and one ladder. There is no key “format” involved at this stage, no prime search of the kind RSA needs, and no structure to get wrong: any integer in range is a valid private key, which is why elliptic-curve key generation is thousands of times faster than its RSA equivalent.
Why publishing Q is safe
Q is dG, and recovering d from it is the discrete logarithm from the previous lesson. On this toy curve that recovery takes eighteen additions, so nothing here is secret in any real sense — that is the point of using a curve small enough to inspect. On P-256 the same recovery is a 2¹²⁸-step search, and 2¹²⁸ steps is not a difficult problem, it is an impossible one. So Q goes into certificates, into JWKS documents, into SSH authorized_keys lines and into passkey registrations, and it can be shouted from a rooftop without consequence.
uncompressed 04 || x || y 65 bytes
compressed 02 or 03 || x 33 bytes (the byte says which
of the two mirrored
y values to use)
JWK {"kty":"EC","crv":"P-256","x":"...","y":"..."} base64url
SPKI/PEM -----BEGIN PUBLIC KEY----- ... DER-wrapped, with an OID
naming the curveThose are four spellings of the same pair of coordinates, and a surprising share of real-world “invalid key” errors are nothing more than one program handing another the wrong spelling. The Certificate Decoder and DER ⇄ Raw Converter exist mostly to settle those arguments.