ECKey key = new ECKey.Builder(ExampleKeyP256Alt.CRV, ExampleKeyP256Alt.X, ExampleKeyP256Alt.Y).build();
// Export
KeyPair pair = key.toKeyPair();
ECPublicKey pub = (ECPublicKey)pair.getPublic();
assertEquals(256, pub.getParams().getCurve().getField().getFieldSize());
assertEquals(ExampleKeyP256Alt.X.decodeToBigInteger(), pub.getW().getAffineX());
assertEquals(ExampleKeyP256Alt.Y.decodeToBigInteger(), pub.getW().getAffineY());
// Import
key = new ECKey.Builder(ExampleKeyP256Alt.CRV, pub).build();
assertEquals(ECKey.Curve.P_256, key.getCurve());
assertEquals(ExampleKeyP256Alt.X, key.getX());