Ejemplo n.º 1
0
        public void TestAzureTableCryptoThrowsTableNotFoundException()
        {
            var keyStore = new SymmetricKeyCache(rsaHelper, tableManager);

            var c = new AzureCrypto(keyStore);

            Action action = () => c.GetEncryptor();
            action.ShouldThrow<AzureCryptoException>();
        }
Ejemplo n.º 2
0
        public void TestAzureTableCryptoHasValidEncryptor()
        {
            var newKey = rsaHelper.CreateNewAesSymmetricKeyset();
            tableManager.AddSymmetricKey(newKey);

            var keyStore = new SymmetricKeyCache(rsaHelper, tableManager);
            var c = new AzureCrypto(keyStore);
            c.Should().NotBeNull("At this stage the contstructor should have succeeded");

            var encryptor = c.GetEncryptor();
            encryptor.Should().NotBeNull("Because the keystore is initialized and there is a key");
        }