public virtual void SetUp()
        {
            jwt     = new JWTCreator();
            options = new JWTOptions();
            keyGen  = new SymmetricKeyGenerator();
            claims  = new PrivateClaims();
            rList   = new RevocationList();



            options.AddRegisteredClaim("iss", "GXSA");
            options.AddRegisteredClaim("sub", "subject1");
            options.AddRegisteredClaim("aud", "audience1");
            ID = "0696bb20-6223-4a1c-9ebf-e15c74387b9c, 0696bb20-6223-4a1c-9ebf-e15c74387b9c";            //&guid.Generate()
            options.AddRegisteredClaim("jti", ID);
            claims.setClaim("hola1", "hola1");
            claims.setClaim("hola2", "hola2");

            String hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256);

            options.SetSecret(hexaKey);
            options.AddRevocationList(rList);

            token = jwt.DoCreate("HS256", claims, options);
        }
Exemple #2
0
 public JWTOptions() : base()
 {
     this.publicClaims     = new PublicClaims();
     this.registeredClaims = new RegisteredClaims();
     this.revocationList   = new RevocationList();
     this.parameters       = new HeaderParameters();
 }
        private bool isRevoqued(JwtSecurityToken jwtToken, JWTOptions options)
        {
            RevocationList rList = options.getRevocationList();

            return(rList.isInRevocationList(jwtToken.Payload.Jti));
        }
Exemple #4
0
 public void AddRevocationList(RevocationList revocationList)
 {
     this.revocationList = revocationList;
 }
Exemple #5
0
 public void DeteleRevocationList()
 {
     this.revocationList = new RevocationList();
 }