private static EciesParameters fromProtoParameters(
      OutputPrefixType outputPrefixType, EciesAeadHkdfParams protoParams)
      throws GeneralSecurityException {
    /* Set OutputPrefixType to RAW when parsing the DEM parameters */
    com.google.crypto.tink.proto.KeyTemplate aeadKeyTemplate =
        com.google.crypto.tink.proto.KeyTemplate.newBuilder()
            .setTypeUrl(protoParams.getDemParams().getAeadDem().getTypeUrl())
            .setOutputPrefixType(OutputPrefixType.RAW)
            .setValue(protoParams.getDemParams().getAeadDem().getValue())
            .build();

    EciesParameters.Builder builder =
        EciesParameters.builder()
            .setVariant(VARIANT_CONVERTER.fromProtoEnum(outputPrefixType))
            .setCurveType(
                CURVE_TYPE_CONVERTER.fromProtoEnum(protoParams.getKemParams().getCurveType()))
            .setHashType(
                HASH_TYPE_CONVERTER.fromProtoEnum(protoParams.getKemParams().getHkdfHashType()))
            .setDemParameters(TinkProtoParametersFormat.parse(aeadKeyTemplate.toByteArray()))
            .setSalt(Bytes.copyFrom(protoParams.getKemParams().getHkdfSalt().toByteArray()));
    if (!protoParams.getKemParams().getCurveType().equals(EllipticCurveType.CURVE25519)) {
      builder.setNistCurvePointFormat(
          POINT_FORMAT_CONVERTER.fromProtoEnum(protoParams.getEcPointFormat()));
    } else {
      if (!protoParams.getEcPointFormat().equals(EcPointFormat.COMPRESSED)) {
        throw new GeneralSecurityException("For CURVE25519 EcPointFormat must be compressed");
      }
    }
    return builder.build();
  }
Registers previously defined parser/serializer objects into a given registry.
java_src/src/main/java/com/google/crypto/tink/hybrid/internal/EciesProtoSerialization.java