public void TestGetCertificateThumbprint()
        {
            var cert = PublishSettingsExtractor.AddPublishSettingsToPersonalMachineStore(Publishsettings);

            var settings = new PublishSettingsExtractor(_fullFileName);
            string thumbprint = settings.GetCertificateThumbprint();
            thumbprint.Should().NotBeNullOrEmpty("Contains a thumbprint from the given file");
            thumbprint.Should().Be(cert.Thumbprint, "The same as the parsed certificate value");

            PublishSettingsExtractor.RemoveFromStore(cert.Thumbprint);
        }
 /// <summary>
 /// Extracts the certificate from a publish settings file and saves it to disk. Very useful when attempting to use fiddler!
 /// </summary>
 /// <param name="publishSettingsFilePath"></param>
 /// <param name="certificatePathToExportTo"></param>
 public void ExportCertificateFromPublishSettingsfile(string publishSettingsFilePath, string certificatePathToExportTo)
 {
     var settings = new PublishSettingsExtractor(publishSettingsFilePath);
     settings.Extract(certificatePathToExportTo);
 }
Exemplo n.º 3
0
 ISqlAzureSecurity ISqlCertificateActivity.AddPublishSettings(string path)
 {
     var settings = new PublishSettingsExtractor(path);
     ManagementCertificate = settings.GetCertificateFromFile();
     return this;
 }
 public void TestGetSubscriptionsInPublishsettings()
 {
     var settings = new PublishSettingsExtractor(_fullFileName);
     var dictionary = settings.GetSubscriptions();
     dictionary.Count.Should().Be(5, "Number of subscriptions in Xml .publishsettings string");
 }
 /// <summary>
 /// Adds a .publishsettings file and extracts the certificate
 /// </summary>
 IVirtualMachineActivity ICertificateActivity.AddPublishSettingsFromFile(string path)
 {
     var settings = new PublishSettingsExtractor(path);
     Properties.Certificate = settings.GetCertificateFromFile();
     return this;
 }