private static EcdsaSignatureEncoding toProtoSignatureEncoding(
      EcdsaParameters.SignatureEncoding encoding) throws GeneralSecurityException {
    if (EcdsaParameters.SignatureEncoding.IEEE_P1363.equals(encoding)) {
      return EcdsaSignatureEncoding.IEEE_P1363;
    }
    if (EcdsaParameters.SignatureEncoding.DER.equals(encoding)) {
      return EcdsaSignatureEncoding.DER;
    }
    throw new GeneralSecurityException("Unable to serialize SignatureEncoding " + encoding);
  }
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