Beispiel #1
0
        public override void Validate(object value)
        {
            var hpkpConfig = (HpkpConfigurationElement)value;

            var validator = new HpkpConfigurationValidator();

            try
            {
                validator.ValidateNumberOfPins(hpkpConfig);
            }
            catch(Exception e)
            {
                throw new ConfigurationErrorsException("HPKP configuration error. Details: " + e.Message, e);
            }
        }
        public override void Validate(object value)
        {
            var reportUri = (string)value;

            if (string.IsNullOrEmpty(reportUri)) return;

            var validator = new HpkpConfigurationValidator();

            try
            {
                validator.ValidateReportUri(reportUri);
            }
            catch(Exception e)
            {
                throw new ConfigurationErrorsException("HPKP configuration error. Details: " + e.Message, e);
            }
        }
 public void Setup()
 {
     _validator = new HpkpConfigurationValidator();
 }
Beispiel #4
0
 public HpkpOptions()
 {
     _pins = new List<string>();
     Config = new HpkpOptionsConfiguration { Pins = _pins };
     _validator = new HpkpConfigurationValidator();
 }