FromThumbprint() public static method

public static FromThumbprint ( string thumbprint ) : X509Certificate2
thumbprint string
return System.Security.Cryptography.X509Certificates.X509Certificate2
Example #1
0
        /// <summary>
        /// Helper method to convert to an in memory subscription object.
        /// </summary>
        /// <returns>The in memory subscription</returns>
        public WindowsAzureSubscription ToAzureSubscription()
        {
            var result = new WindowsAzureSubscription
            {
                SubscriptionName        = this.Name,
                SubscriptionId          = this.SubscriptionId,
                ServiceEndpoint         = !string.IsNullOrEmpty(ManagementEndpoint) ? new Uri(ManagementEndpoint) : null,
                ResourceManagerEndpoint = !string.IsNullOrEmpty(ResourceManagerEndpoint) ? new Uri(ResourceManagerEndpoint) : null,
                ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
                ActiveDirectoryTenantId = ActiveDirectoryTenantId,
                ActiveDirectoryUserId   = ActiveDirectoryUserId,
                ActiveDirectoryServiceEndpointResourceId = ActiveDirectoryServiceEndpointResourceId,
                IsDefault   = this.IsDefault,
                Certificate = !string.IsNullOrEmpty(ManagementCertificate) ? WindowsAzureCertificate.FromThumbprint(ManagementCertificate) : null,
                CurrentStorageAccountName = CloudStorageAccount,
                GalleryEndpoint           = !string.IsNullOrEmpty(GalleryEndpoint) ? new Uri(GalleryEndpoint) : null,
                SqlDatabaseDnsSuffix      = SqlDatabaseDnsSuffix ?? WindowsAzureEnvironmentConstants.AzureSqlDatabaseDnsSuffix,
            };

            RegisteredResourceProviders = RegisteredResourceProviders ?? new string[0];
            foreach (var resource in RegisteredResourceProviders)
            {
                result.RegisteredResourceProviders.Add(resource);
            }
            return(result);
        }
Example #2
0
        /// <summary>
        /// Helper method to convert to an in memory subscription object.
        /// </summary>
        /// <returns>The in memory subscription</returns>
        public WindowsAzureSubscription ToAzureSubscription()
        {
            var result = new WindowsAzureSubscription
            {
                SubscriptionName        = this.Name,
                SubscriptionId          = this.SubscriptionId,
                ServiceEndpoint         = new Uri(ManagementEndpoint),
                ActiveDirectoryEndpoint = ActiveDirectoryEndpoint,
                ActiveDirectoryTenantId = ActiveDirectoryTenantId,
                ActiveDirectoryUserId   = ActiveDirectoryUserId,
                IsDefault   = this.IsDefault,
                Certificate = !string.IsNullOrEmpty(ManagementCertificate) ? WindowsAzureCertificate.FromThumbprint(ManagementCertificate) : null,
                CurrentStorageAccountName = CloudStorageAccount
            };

            RegisteredResourceProviders = RegisteredResourceProviders ?? new string[0];
            foreach (var resource in RegisteredResourceProviders)
            {
                result.RegisteredResourceProviders.Add(resource);
            }
            return(result);
        }