private static EcdsaParameters.Variant toVariant(OutputPrefixType outputPrefixType)
      throws GeneralSecurityException {
    switch (outputPrefixType) {
      case TINK:
        return EcdsaParameters.Variant.TINK;
      case CRUNCHY:
        return EcdsaParameters.Variant.CRUNCHY;
      case LEGACY:
        return EcdsaParameters.Variant.LEGACY;
      case RAW:
        return EcdsaParameters.Variant.NO_PREFIX;
      default:
        throw new GeneralSecurityException(
            "Unable to parse OutputPrefixType: " + outputPrefixType.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