Exemple #1
0
        public void WrapUnwrapKey()
        {
            var alg       = new AesKeyWrapManagement(256);
            var encrypted = alg.WrapKey(_secret, _key);
            var decrypted = alg.UnwrapKey(encrypted, _key);

            Assert.Equal(decrypted, _secret);
        }
Exemple #2
0
        public void WrapUnwrapKey_NotEqual()
        {
            var key       = new HMACSHA256(Utils.Random(256));
            var alg       = new AesKeyWrapManagement(256);
            var encrypted = alg.WrapKey(_secret, _key);
            var decrypted = alg.UnwrapKey(encrypted, key);

            Assert.NotEqual(decrypted, _secret);
        }