public void TestPositive()
        {
            bool verification = jwt.DoVerify(token, "HS256", claims, options);

            Assert.IsTrue(verification);
            True(verification, jwt);
        }
示例#2
0
        public void Test_expValidationPositive()
        {
            options.AddCustomTimeValidationClaim("exp", "2030/07/07 10:15:20", "20");
            string token      = jwt.DoCreate("HS256", claims, options);
            bool   validation = jwt.DoVerify(token, "HS256", claims, options);

            Assert.IsTrue(validation);
        }
        public void GenerateToken()
        {
            string hexaKey = keyGen.doGenerateKey("GENERICRANDOM", 256);

            options.SetSecret(hexaKey);
            token = jwt.DoCreate("HS256", claims, options);
            Assert.IsFalse(jwt.HasError());
            bool verification = jwt.DoVerify(token, "HS256", claims, options);

            True(verification, jwt);
        }
示例#4
0
        public void TestVerificationWithoutPrivateKey()
        {
            bool validation = jwt.DoVerify(token, "RS256", claims, options2);

            //System.out.println("Error. Code: " + jwt.getErrorCode() + " Desc: " + jwt.getErrorDescription());
            Assert.IsTrue(validation);
        }
示例#5
0
        public void TestPositive()
        {
            string payload      = jwt.GetPayload(token);
            bool   verification = jwt.DoVerify(token, "HS256", claimslevel1, options);

            True(verification, jwt);
        }
        private void bulkTest_shouldWork(PrivateKeyManager key, CertificateX509 cert, string alg, string curve)
        {
            options.SetPrivateKey(key);
            options.SetCertificate(cert);
            string token = jwt.DoCreate(alg, claims, options);

            Assert.IsFalse(jwt.HasError());
            bool verification = jwt.DoVerify(token, alg, claims, options);

            True(verification, jwt);
        }
        public void TestPositive()
        {
            bool verification = jwt.DoVerify(token, "HS256", claimslevel1, options);

            True(verification, jwt);
        }