private static JwtHmacParameters.Algorithm toAlgorithm(JwtHmacAlgorithm hashType)
      throws GeneralSecurityException {
    switch (hashType) {
      case HS256:
        return JwtHmacParameters.Algorithm.HS256;
      case HS384:
        return JwtHmacParameters.Algorithm.HS384;
      case HS512:
        return JwtHmacParameters.Algorithm.HS512;
      default:
        throw new GeneralSecurityException("Unable to parse HashType: " + hashType.getNumber());
    }
  }
Methods to serialize and parse {@link JwtHmacKey} objects and {@link JwtHmacParameters} objects.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtHmacProtoSerialization.java