Enhanced documentation. This resolves #12 and #16.

This commit is contained in:
Les Hazlewood 2015-03-14 17:44:56 -07:00
parent 47ec679046
commit 27ec90f35a
1 changed files with 6 additions and 6 deletions

View File

@ -36,14 +36,14 @@ Most complexity is hidden behind a convenient and readable builder-based [fluent
```java ```java
import io.jsonwebtoken.Jwts; import io.jsonwebtoken.Jwts;
import static io.jsonwebtoken.SignatureAlgorithm.*; import io.jsonwebtoken.SignatureAlgorithm;
//Let's create a random signing key for testing: // We need a signing key, so we'll create one just for this example. Usually
Random random = new SecureRandom(); // the key would be read from your application configuration instead.
byte[] key = new byte[64]; byte[] key = new byte[64];
random.nextBytes(key); new SecureRandom().nextBytes(key);
String compact = Jwts.builder().setSubject("Joe").signWith(HS256, key).compact(); String compact = Jwts.builder().setSubject("Joe").signWith(SignatureAlgorithm.HS256, key).compact();
``` ```
How easy was that!? How easy was that!?