Inheritance: ObjectIdentifier
        public RemoveKeyVaultKeyTests()
        {
            base.SetupTest();

            cmdlet = new RemoveAzureKeyVaultKey()
            {
                CommandRuntime = commandRuntimeMock.Object,
                DataServiceClient = keyVaultClientMock.Object,
                VaultName = VaultName
            };

            keyAttributes = new KeyAttributes(true, DateTime.Now, DateTime.Now, "HSM", new string[]{"All"});
            webKey = new WebKey.JsonWebKey();
            keyBundle = new KeyBundle() { Attributes = keyAttributes, Key = webKey, Name = KeyName, VaultName = VaultName };
        }
Exemplo n.º 2
0
        internal KeyIdentityItem(KeyBundle keyBundle)
        {
            if (keyBundle == null)
                throw new ArgumentNullException("keyBundle");
            if (keyBundle.Attributes == null)
                throw new ArgumentException(KeyVaultProperties.Resources.InvalidKeyAttributes);

            SetObjectIdentifier(keyBundle);

            Enabled = keyBundle.Attributes.Enabled;
            Expires = keyBundle.Attributes.Expires;
            NotBefore = keyBundle.Attributes.NotBefore;
            Created = keyBundle.Attributes.Created;
            Updated = keyBundle.Attributes.Updated;
            Tags = keyBundle.Attributes.Tags;
        }
        public SetKeyVaultKeyTests()
        {
            base.SetupTest();

            keyAttributes = new KeyAttributes(true, DateTime.Now, DateTime.Now, null, null);
            webKey = new WebKey.JsonWebKey();
            keyBundle = new KeyBundle() { Attributes = keyAttributes, Key = webKey, Name = KeyName, VaultName = VaultName, Version = KeyVersion };

            cmdlet = new SetAzureKeyVaultKey()
            {
                CommandRuntime = commandRuntimeMock.Object,
                DataServiceClient = keyVaultClientMock.Object,
                VaultName = VaultName,
                Enable = (bool)keyAttributes.Enabled,
                Expires = keyAttributes.Expires,
                NotBefore = keyAttributes.NotBefore,
                Name = KeyName
            };
        }
Exemplo n.º 4
0
        internal KeyIdentityItem(KeyBundle keyBundle)
        {
            if (keyBundle == null)
            {
                throw new ArgumentNullException("keyBundle");
            }
            if (keyBundle.Attributes == null)
            {
                throw new ArgumentException(KeyVaultProperties.Resources.InvalidKeyAttributes);
            }

            SetObjectIdentifier(keyBundle);

            Enabled   = keyBundle.Attributes.Enabled;
            Expires   = keyBundle.Attributes.Expires;
            NotBefore = keyBundle.Attributes.NotBefore;
            Created   = keyBundle.Attributes.Created;
            Updated   = keyBundle.Attributes.Updated;
            Tags      = keyBundle.Attributes.Tags;
        }