Exemplo n.º 1
0
        internal static X509Certificate2 LoadKeyVaultCertificate(string secretName)
        {
            KeyVaultWrapper  kvw         = KeyVaultWrapper.GetTestInfraKeyVaultWrapper();
            string           keyVaultUri = KeyVaultWrapper.GetTestInfraKeyVaultUri();
            X509Certificate2 cert        = kvw.GetCertificateFromSecret(keyVaultUri, secretName);
            var certBytes = cert.Export(X509ContentType.Pfx);

            return(new X509Certificate2(certBytes));
        }
Exemplo n.º 2
0
        public static string GetXStoreTestResourcesConnectionString()
        {
            var keyVaultUri = KeyVaultWrapper.GetTestInfraKeyVaultUri();
            var kvw         = KeyVaultWrapper.GetTestInfraKeyVaultWrapper();
            var storageKey  = kvw.GetSecret(keyVaultUri, TestUtility.TestResourcesStorageAccountKeyName);

            return(string.Format(
                       CultureInfo.InvariantCulture,
                       "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}",
                       TestUtility.TestResourcesStorageAccountName,
                       storageKey));
        }
Exemplo n.º 3
0
        public static string GetAzureImageStoreConnectionString(string accountName, string containerName)
        {
            const string KeyVaultClientId = "33e3af95-cf38-49be-9db9-909bb5b3cb2e";
            const string KeyVaultCliedIdAppCertThumbprint = "6108D2170756888910B43787F0FE8C6DD9162FE7";
            const string KeyVaultUri = "https://TestInfraKeyVault.vault.azure.net";
            const string WinFabCitStoreAccountKeySecretName = "AccountKey-winfabcit";

            var kvw        = new KeyVaultWrapper(KeyVaultClientId, KeyVaultCliedIdAppCertThumbprint);
            var accountKey = kvw.GetSecret(KeyVaultUri, WinFabCitStoreAccountKeySecretName);

            return(string.Format(
                       CultureInfo.InvariantCulture,
                       "xstore:DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1};Container={2}",
                       accountName,
                       accountKey,
                       containerName));
        }
        private static string GetTestStorageAccountKey()
        {
            var kvw = KeyVaultWrapper.GetTestInfraKeyVaultWrapper();

            return(kvw.GetSecret(KeyVaultWrapper.GetTestInfraKeyVaultUri(), WinFabCitStoreAccountKeySecretName));
        }