title: NoMethodError when calling JJWT from Kotlin
body: <p>I'm working on a small Spring Boot application in Kotlin and now I want to secure it using JJWT. Roughly speaking, I am translating this tutorial to my use case: <a href="https://jakublesko.com/spring-security-with-jwt/" rel="nofollow noreferrer">https://jakublesko.com/spring-security-with-jwt/</a></p>
  
  <p>In the project I have this AuthenticationFilter:</p>
  
  <pre><code>class JwtAuthenticationFilter(val authManager: AuthenticationManager) : UsernamePasswordAuthenticationFilter() {
  
      // other stuff omitted for brevity
  
      override fun successfulAuthentication(request: HttpServletRequest?, response: HttpServletResponse?, chain: FilterChain?, authResult: Authentication?) {
          val user = authResult?.principal as User
  
          val roles = user.authorities
                  .stream()
                  .map(GrantedAuthority::getAuthority)
  
          val signingKey = JWT_SECRET.toByteArray()
  
          val token = Jwts.builder()
                  .signWith(SignatureAlgorithm.HS512, Keys.hmacShaKeyFor(signingKey))
                  .setHeaderParam("typ", TOKEN_TYPE) // validate that "typ" does not actually mean "type"
                  .setIssuer(TOKEN_ISSUER)
                  .setAudience(TOKEN_AUDIENCE)
                  .setSubject(user.username)
                  .setExpiration(Date(System.currentTimeMillis() + 864000000))
                  .claim("rol", roles)
                  .compact()
  
          response?.addHeader(TOKEN_HEADER, TOKEN_PREFIX + token)
      }
  }
  </code></pre>
  
  <p>When I post to the authentication URL that is supposed to issue a token though, I receive:</p>
  
  <p><code>java.lang.NoSuchMethodError: io.jsonwebtoken.SignatureAlgorithm.getMinKeyLength()I
      at io.jsonwebtoken.security.Keys.hmacShaKeyFor(Keys.java:69) ~[jjwt-api-0.10.7.jar:na]</code></p>
  
  <p>I can debug into the <code>successfulAuthentication</code> method and see that it is called with reasonable parameters. What catches my eye is the "I" after the parenthesis at the end of the <code>getMinKeyLength()I</code>. My googling skills apparently do not suffice to find a reason why it is there, but I strongly suspect it is related to reflection &amp; calling Java libs from Kotlin code.</p>
  
  <p>Is anyone around who can tell me how to fix this? I have run out of guesses.</p>