/// <summary>
 /// Initializes a new instance of the <see cref="AcsNamespace"/> class.
 /// </summary>
 /// <param name="acsDetails">authenticating service Details name</param>
 public AcsNamespace(UploadCertificateResponse acsDetails)
 {
     this.HostName = acsDetails.Properties.GlobalAcsHostName;
     this.Namespace = acsDetails.Properties.GlobalAcsNamespace;
     this.ResourceProviderRealm = acsDetails.Properties.GlobalAcsRPRealm;
 }
        /// <summary>
        /// Method to generate the credential file content
        /// </summary>
        /// <param name="managementCert">management cert</param>
        /// <param name="acsDetails">ACS details</param>
        /// <param name="channelIntegrityKey">Integrity key</param>
        /// <param name="vault">vault object</param>
        /// <param name="site">site object</param>
        /// <returns>vault credential object</returns>
        private ASRVaultCreds GenerateCredentialObject(X509Certificate2 managementCert, UploadCertificateResponse acsDetails, string channelIntegrityKey, ASRVault vault, ASRSite site)
        {
            string serializedCertifivate = Convert.ToBase64String(managementCert.Export(X509ContentType.Pfx));

            AcsNamespace acsNamespace = new AcsNamespace(acsDetails);

            string resourceProviderNamespace = string.Empty;
            string resourceType = string.Empty;
            Utilities.GetResourceProviderNamespaceAndType(vault.ID, out resourceProviderNamespace, out resourceType);
            ASRVaultCreds vaultCreds = new ASRVaultCreds(
                                            vault.SubscriptionId,
                                            vault.Name,
                                            serializedCertifivate,
                                            acsNamespace,
                                            channelIntegrityKey,
                                            vault.ResouceGroupName,
                                            site.ID,
                                            site.Name,
                                            resourceProviderNamespace,
                                            resourceType);

            return vaultCreds;
        }