public void generateClientKeyExchange(OutputStream os) throws IOException {
   if (agreementCredentials != null) {
     TlsUtils.writeUint24(0, os);
   } else {
     generateEphemeralClientKeyExchange(ecAgreeServerPublicKey.getParameters(), os);
   }
 }
  protected byte[] externalizeKey(ECPublicKeyParameters keyParameters) throws IOException {
    // TODO Add support for compressed encoding and SPF extension

    /*
     * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format.
     * Here, the format MUST conform to what the server has requested through a
     * Supported Point Formats Extension if this extension was used, and MUST be
     * uncompressed if this extension was not used.
     */
    return keyParameters.getQ().getEncoded();
  }