public static KeyTemplate createHmacKeyTemplate(int keySize, int tagSize, HashType hashType) {
    HmacParams params = HmacParams.newBuilder()
        .setHash(hashType)
        .setTagSize(tagSize)
        .build();
    HmacKeyFormat format = HmacKeyFormat.newBuilder()
        .setParams(params)
        .setKeySize(keySize)
        .build();
    return KeyTemplate.newBuilder()
        .setValue(format.toByteString())
        .setTypeUrl(HmacKeyManager.getKeyType())
        .setOutputPrefixType(OutputPrefixType.TINK)
        .build();
  }
@return a {@link KeyTemplate} containing a {@link HmacKeyFormat} with some specified
    parameters.
java_src/src/main/java/com/google/crypto/tink/mac/MacKeyTemplates.java