@SuppressWarnings("UnusedException")
  private static EcdsaPublicKey parsePublicKey(
      ProtoKeySerialization serialization, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    if (!serialization.getTypeUrl().equals(PUBLIC_TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to EcdsaProtoSerialization.parsePublicKey: "
              + serialization.getTypeUrl());
    }
    try {
      com.google.crypto.tink.proto.EcdsaPublicKey protoKey =
          com.google.crypto.tink.proto.EcdsaPublicKey.parseFrom(
              serialization.getValue(), ExtensionRegistryLite.getEmptyRegistry());
      if (protoKey.getVersion() != 0) {
        throw new GeneralSecurityException("Only version 0 keys are accepted");
      }
      EcdsaParameters parameters =
          EcdsaParameters.builder()
              .setHashType(toHashType(protoKey.getParams().getHashType()))
              .setSignatureEncoding(toSignatureEncoding(protoKey.getParams().getEncoding()))
              .setCurveType(toCurveType(protoKey.getParams().getCurve()))
              .setVariant(toVariant(serialization.getOutputPrefixType()))
              .build();
      return EcdsaPublicKey.builder()
          .setParameters(parameters)
          .setPublicPoint(
              new ECPoint(
                  BigIntegerEncoding.fromUnsignedBigEndianBytes(protoKey.getX().toByteArray()),
                  BigIntegerEncoding.fromUnsignedBigEndianBytes(protoKey.getY().toByteArray())))
          .setIdRequirement(serialization.getIdRequirementOrNull())
          .build();
    } catch (InvalidProtocolBufferException | IllegalArgumentException e) {
      throw new GeneralSecurityException("Parsing EcdsaPublicKey failed");
    }
  }
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