示例#1
0
        public void NoneAlgorithm()
        {
            IAlgorithm algorithm = new NoneAlgorithm();

            JwtHandler jwtHandler = new JwtHandler();
            String     jwtString  = jwtHandler.Encode(Payload, algorithm);
            Payload    payload    = jwtHandler.Decode <Payload>(jwtString, algorithm);

            Assert.IsTrue(payload != null && Payload.Username == payload.Username);
        }
        public IAlgorithmWithKeyBuilder WithAlgorithm(NoneAlgorithmType algorithmType)
        {
            Algorithm = new NoneAlgorithm();

            return(this);
        }