Skip to content

A JSON Web Token (JWT) / JSON Web Signature (JWS) implementation for Android

License

Notifications You must be signed in to change notification settings

DavidBenko/DBWebSignatureAndroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSON Web Token (JWT) / JSON Web Signature (JWS)

JWT/JWS for Android. Creates and Validates signatures for JSON Objects.

Installation

Add the dbwebsignature folder to your project.

Usage

Generating Tokens

JSONObject objectToSign = ... // Can also be JSONArray or String

DBWebSignature signer = new DBWebSignature("mutually-derived-or-agreed-secret", new JWTAlgorithmHS512());
String token = signer.getToken(objectToSign);

Verifying Tokens

String tokenToVerify = "jbd6567asbsdahjbskg32y78";
JSONObject objectToVerify = ... // Can also be JSONArray or String

DBWebSignature signer = new DBWebSignature("mutually-derived-or-agreed-secret", new JWTAlgorithmHS512());
boolean validToken = signer.validateToken(tokenToVerify, objectToVerify);

Algorithms

Supported Algorithms

  • HS512 (HMAC, SHA-512)
  • HS256 (HMAC, SHA-256)

Additional algorithms can be added by implementing the DBWebSignatureAlgorithm interface.

About

A JSON Web Token (JWT) / JSON Web Signature (JWS) implementation for Android

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages