private static EcdsaParameters.HashType toHashType(HashType hashType)
      throws GeneralSecurityException {
    switch (hashType) {
      case SHA256:
        return EcdsaParameters.HashType.SHA256;
      case SHA384:
        return EcdsaParameters.HashType.SHA384;
      case SHA512:
        return EcdsaParameters.HashType.SHA512;
      default:
        throw new GeneralSecurityException(
            "Unable to parse HashType: " + hashType.getNumber());
    }
  }
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