public void WhenIValidateTheSecureArmorToken()
        {
            var standardArmorTokenValidator = new SecureArmorTokenValidator(secureArmorToken, encryptionKey, hashingKey, "*****@*****.**", 300000);

            standardArmorTokenValidator.Execute();

            armorTokenValidationStepResult = standardArmorTokenValidator.ArmorTokenValidationStepResult;
        }
 public override void Execute()
 {
     ArmorTokenValidationStepResult = new ArmorTokenValidationStepResult {
         IsValid = true,
         Message = "Untampered",
         Output  = armorToken
     };
 }
 public override void Execute()
 {
     armorTokenDeserialisor.Deserialise(armorToken);
     ArmorTokenValidationStepResult = new ArmorTokenValidationStepResult {
         IsValid = true,
         Message = "Untampered",
         Output  = armorTokenDeserialisor.DeserialisedArmorToken
     };
 }
Example #4
0
        public override void Execute()
        {
            var userIdClaimValidator = userIdClaimValidatorFactory.CreateClaimValidator(armorToken.Claims);

            userIdClaimValidator.Execute();

            if (!userIdClaimValidator.IsValid)
            {
                ArmorTokenValidationStepResult = new ArmorTokenValidationStepResult {
                    IsValid = false,
                    Message = "Tampered"
                };

                return;
            }

            var timeStampClaimValidator = timeStampClaimValidatorFactory.CreateClaimValidator(armorToken.Claims);

            timeStampClaimValidator.Execute();

            if (!timeStampClaimValidator.IsValid)
            {
                ArmorTokenValidationStepResult = new ArmorTokenValidationStepResult {
                    IsValid = false,
                    Message = "Tampered"
                };

                return;
            }

            ArmorTokenValidationStepResult = new ArmorTokenValidationStepResult {
                IsValid = true,
                Message = "Untampered",
                Output  = armorToken
            };
        }