protected PropertyObject(ObjectIdentifier identifier, IDictionary <string, string> tags,
                                 bool?enabled, DateTime?expires, DateTime?notBefore,
                                 PropertyChangedEventHandler propertyChanged)
        {
            Identifier = identifier;
            Name       = identifier?.Name;

            Tags = new ObservableTagItemsCollection();
            if (null != tags)
            {
                foreach (var kvp in tags)
                {
                    Tags.Add(new TagItem(kvp));
                }
            }
            Tags.SetPropertyChangedEventHandler(propertyChanged);

            _enabled   = enabled;
            _expires   = expires;
            _notBefore = notBefore;

            SecretKind = new SecretKind(); // Default - Custom secret kind

            PropertyChanged += propertyChanged;
        }
        public void FillTagsAndExpiration(PropertyObject obj)
        {
            ObservableTagItemsCollection tags = obj.Tags;

            tags.AddOrReplace(new TagItem("Thumbprint", Certificate.Thumbprint.ToLowerInvariant()));
            tags.AddOrReplace(new TagItem("Expiration", Certificate.GetExpirationDateString()));
            tags.AddOrReplace(new TagItem("Subject", Certificate.GetNameInfo(X509NameType.SimpleName, false)));
            var sans =
                from X509Extension ext in Certificate.Extensions
                where ext.Oid.Value == "2.5.29.17" // Subject Alternative Name
                select ext.Format(false).Replace("DNS Name=", "");

            tags.AddOrReplace(new TagItem("SAN", string.Join(";", sans)));
            obj.NotBefore = Certificate.NotBefore;
            obj.Expires   = Certificate.NotAfter;
        }
        public PropertyObjectVault(Subscription s, string resourceGroupName, Microsoft.Azure.Management.KeyVault.Models.Vault vault)
        {
            _subscription      = s;
            _resourceGroupName = resourceGroupName;
            _vault             = vault;
            Tags = new ObservableTagItemsCollection();
            if (null != _vault.Tags)
            {
                foreach (var kvp in _vault.Tags)
                {
                    Tags.Add(new TagItem(kvp));
                }
            }
            AccessPolicies = new ObservableAccessPoliciesCollection();
            int i = -1;

            foreach (var ape in _vault.Properties.AccessPolicies)
            {
                AccessPolicies.Add(new AccessPolicyEntryItem(++i, ape));
            }
        }