private static EllipticCurveType toProtoCurveType(EcdsaParameters.CurveType curveType)
      throws GeneralSecurityException {
    if (EcdsaParameters.CurveType.NIST_P256.equals(curveType)) {
      return EllipticCurveType.NIST_P256;
    }
    if (EcdsaParameters.CurveType.NIST_P384.equals(curveType)) {
      return EllipticCurveType.NIST_P384;
    }
    if (EcdsaParameters.CurveType.NIST_P521.equals(curveType)) {
      return EllipticCurveType.NIST_P521;
    }
    throw new GeneralSecurityException("Unable to serialize CurveType " + curveType);
  }
Methods to serialize and parse {@link EcdsaPrivateKey} and {@link EcdsaPublicKey} objects and
{@link EcdsaParameters} objects.
java_src/src/main/java/com/google/crypto/tink/signature/internal/EcdsaProtoSerialization.java