public static CertificateCloudCredentials Create(IDictionary <string, object> settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            X509Certificate2 certificate = PlatformConfigurationHelper.GetCertificate(settings, "ManagementCertificate", false);

            if (settings.ContainsKey("SubscriptionId"))
            {
                return(new CertificateCloudCredentials(settings["SubscriptionId"].ToString(), certificate));
            }

            return(null);
        }
        /// <summary>
        /// Attempt to create certificate credentials from a collection of
        /// settings.
        /// </summary>
        /// <param name="settings">The settings to use.</param>
        /// <returns>
        /// CertificateCloudCredentials is created, null otherwise.
        /// </returns>
        public static CertificateCloudCredentials Create(IDictionary <string, object> settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            string           subscriptionId = ConfigurationHelper.GetString(settings, "SubscriptionId", false);
            X509Certificate2 certificate    = PlatformConfigurationHelper.GetCertificate(settings, "ManagementCertificate", false);

            if (subscriptionId != null && certificate != null)
            {
                return(new CertificateCloudCredentials(subscriptionId, certificate));
            }

            return(null);
        }