Skip to main content
replaced https://tools.ietf.org/html/rfc with https://www.rfc-editor.org/rfc/rfc
Source Link

The JWT JWA specification REQUIRESREQUIRES that HMAC signing keys have lengths equal to or greater than the signature byte array length.

The JWT JWA specification REQUIRES that HMAC signing keys have lengths equal to or greater than the signature byte array length.

The JWT JWA specification REQUIRES that HMAC signing keys have lengths equal to or greater than the signature byte array length.

continued edits for clarity
Source Link
Les Hazlewood
  • 19.8k
  • 14
  • 71
  • 79

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) enforces that the specified Key is strong enough for the specified SignatureAlgorithm perallows you to specify a desired algorithm if you don't want the RFC requirementsstrongest possible one. Both

Both methods will reject any Key that doesn't meet the minimum RFC requirements.

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) enforces that the specified Key is strong enough for the specified SignatureAlgorithm per the RFC requirements. Both methods will reject any Key that doesn't meet the minimum RFC requirements.

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) allows you to specify a desired algorithm if you don't want the strongest possible one.

Both methods will reject any Key that doesn't meet the minimum RFC requirements.

added 2 characters in body
Source Link
Les Hazlewood
  • 19.8k
  • 14
  • 71
  • 79

As ofWith JJWT >= 0.10.0, signWith(SignatureAlgorithm var1, String var2) has been deprecated because of the confusion between raw strings and Base64-encoded strings:

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) enforces that the specified Key is strong enough for the specified SignatureAlgorithm per the RFC requirements. Both methods will reject any Key that doesn't meet the minimum RFC requirements.

As of JJWT 0.10.0, signWith(SignatureAlgorithm var1, String var2) has been deprecated because of the confusion between raw strings and Base64-encoded strings:

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) enforces that the specified Key is strong enough for the specified SignatureAlgorithm per the RFC requirements.

With JJWT >= 0.10.0, signWith(SignatureAlgorithm var1, String var2) has been deprecated because of the confusion between raw strings and Base64-encoded strings:

signWith(Key) is recommended to let JJWT figure out the strongest algorithm possible based on the strength of your supplied key. signWith(Key,SignatureAlgorithm) enforces that the specified Key is strong enough for the specified SignatureAlgorithm per the RFC requirements. Both methods will reject any Key that doesn't meet the minimum RFC requirements.

Updated to reflect more recent JJWT API and documentation and recommended practices.
Source Link
Les Hazlewood
  • 19.8k
  • 14
  • 71
  • 79
Loading
Source Link
Les Hazlewood
  • 19.8k
  • 14
  • 71
  • 79
Loading