private static EcdsaParameters.SignatureEncoding toSignatureEncoding(
      EcdsaSignatureEncoding encoding) throws GeneralSecurityException {
    switch (encoding) {
      case IEEE_P1363:
        return EcdsaParameters.SignatureEncoding.IEEE_P1363;
      case DER:
        return EcdsaParameters.SignatureEncoding.DER;
      default:
        throw new GeneralSecurityException(
            "Unable to parse EcdsaSignatureEncoding: " + encoding.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