private static HkdfPrfParameters parseParameters(ProtoParametersSerialization serialization)
      throws GeneralSecurityException {
    if (!serialization.getKeyTemplate().getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to HkdfPrfProtoSerialization.parseParameters: "
              + serialization.getKeyTemplate().getTypeUrl());
    }
    com.google.crypto.tink.proto.HkdfPrfKeyFormat format;
    try {
      format =
          com.google.crypto.tink.proto.HkdfPrfKeyFormat.parseFrom(
              serialization.getKeyTemplate().getValue(), ExtensionRegistryLite.getEmptyRegistry());
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing HkdfPrfParameters failed: ", e);
    }
    if (format.getVersion() != 0) {
      throw new GeneralSecurityException(
          "Parsing HkdfPrfParameters failed: unknown Version " + format.getVersion());
    }
    if (serialization.getKeyTemplate().getOutputPrefixType() != OutputPrefixType.RAW) {
      throw new GeneralSecurityException(
          "Parsing HkdfPrfParameters failed: only RAW output prefix type is accepted");
    }
    return HkdfPrfParameters.builder()
        .setKeySizeBytes(format.getKeySize())
        .setHashType(toHashType(format.getParams().getHash()))
        .setSalt(Bytes.copyFrom(format.getParams().getSalt().toByteArray()))
        .build();
  }
Methods to serialize and parse {@link HkdfPrfKey} objects and {@link HkdfPrfParameters} objects.
java_src/src/main/java/com/google/crypto/tink/prf/internal/HkdfPrfProtoSerialization.java