TokenUtil { public static boolean verifyToken( String token, String sharedKey ) throws SystemSecurityException { return verifySignatureAndDate( token, sharedKey ); } private  TokenUtil(); static String createToken( String headerJson, String claimJson, String sharedKey ); static boolean verifySignature( String token, String sharedKey ); static String getSubject( String token ); static boolean verifyToken( String token, String sharedKey ); static boolean verifySignatureAndDate( String token, String sharedKey ); static boolean isDateValid( String token ); static Payload parseToken( JWSObject jwsObject ); static Payload parseToken( String token ); static long getDate( String token ); static long getDate( JWSObject jwsObject ); static String createTokenRSA( PrivateKey privateKey, String claimJson ); static boolean verifyTokenRSA( PublicKey pKey, String token );  }
@Test public void testVerifyToken() { String token = createToken(); assertTrue( verifyTokenSignature(token) ); }