Beispiel #1
0
        public void SecretKeyProvider_NewSecret_LengthNegative1_ThrowArgumentOutOfRangeException()
        {
            int length = -1;

            SecretKeyProvider secrets = new SecretKeyProvider();

            secrets.NewSecret(length);
        }
        public ActionResult InitialSetup()
        {
            SecretKeyProvider secretKeyProvider = new SecretKeyProvider();

            ViewBag.EncryptionKey      = secretKeyProvider.NewSecretBase64(32);
            ViewBag.EmergencyAccessKey = secretKeyProvider.NewSecret(32);

            return(View());
        }
Beispiel #3
0
        public void SecretKeyProvider_NewSecret_Length64_ReturnKeyWith64Length()
        {
            int length = 64;

            SecretKeyProvider secrets = new SecretKeyProvider();

            string secret = secrets.NewSecret(length);

            Assert.AreEqual(length, secret.Length);
        }