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