Exemple #1
0
        public bool Validate(KeysLastReleaseTeksArgs args)
        {
            if (args == null)
            {
                return(false);
            }

            if (!ResourceBundleValidator.IsBase64(args.BucketId))
            {
                return(false);
            }

            if (_Config.TemporaryExposureKeyCountMin > args.Keys.Length ||
                args.Keys.Length > _Config.TemporaryExposureKeyCountMax)
            {
                return(false);
            }

            return(args.Keys.All(_TemporaryExposureKeyValidator.Valid));
        }
        public void IsBase64Test()
        {
            var thing = Convert.ToBase64String(Encoding.UTF8.GetBytes("Klingons off the starboard bow!"));

            Assert.IsTrue(ResourceBundleValidator.IsBase64(thing));
        }