private static com.google.crypto.tink.proto.HmacParams getProtoParams(HmacParameters parameters)
      throws GeneralSecurityException {
    return com.google.crypto.tink.proto.HmacParams.newBuilder()
        .setTagSize(parameters.getCryptographicTagSizeBytes())
        .setHash(HASH_TYPE_CONVERTER.toProtoEnum(parameters.getHashType()))
        .build();
  }
Methods to serialize and parse {@link HmacKey} objects and {@link HmacParameters} objects.
java_src/src/main/java/com/google/crypto/tink/mac/internal/HmacProtoSerialization.java