C# Class Elastacloud.AzureManagement.Fluent.Helpers.PublishSettings.PublishSettingsExtractor

Used to get certificates from the store or from .publishsettings
Show file Open project: azurecoder/fluent-management Class Usage Examples

Public Methods

Method Description
AddAllPublishSettingsCertificatesToPersonalMachineStore ( string subscriptionId = null ) : List

Publishsettings file added to the machine store with the subcription id

AddPublishSettingsToPersonalMachineStore ( StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2

Takes an xml document and adds to a store

AddPublishSettingsToPersonalMachineStore ( string xml, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2

Adds a certificate to the local machine personal store

Extract ( string fileNameOut ) : void

Will extract a .publishsettings file certificate and then export as a .cer file

ExtractCertObject ( System.IO.FileType type ) : X509Certificate2

Used to extract a certificate from a file

ExtractPfxObject ( string password ) : X509Certificate2

Used to extract a pfk from a file

FromStore ( string thumbprint, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2

Checks through the CurrentUser and LocalMachine Personal and AuthRoot stores

GetCertificateFromFile ( string managementCertificate = null, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2

Gets the certificate data from a file - can be a .cer file or publishsettings - exports the private key with the certificate

GetCertificateFromXml ( string xml, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
GetCertificateThumbprint ( ) : string

Gets the certificate thumbprint value from the publishsettings xml

GetFromFile ( string file ) : PublishSettingsExtractor

Returns a PublishSettingsExtractor given a valid path

GetFromXml ( string xml ) : PublishSettingsExtractor

Returns a PublishSettingsExtractor given a valid xml document

GetSubscriptions ( ) : List

Gets a list of subscriptions in a .publishsettings file

PublishSettingsExtractor ( string filePath, bool xmlContent = false ) : System

Used to construct a publishsetting extractor class

RemoveFromStore ( string thumbprint, StoreLocation location = StoreLocation.CurrentUser ) : void

Remove a publishsettings file from the store

this ( string subscriptionId ) : Subscription

The indexer takes a subscription id string and returns a Subscription

Private Methods

Method Description
FromStore ( string thumbprint, StoreName storeName, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2

Used to check whether the certificate is in the underlying storename and location

Parse ( ) : void

Used to parse a .publishsettings file to determine the schema

Method Details

AddAllPublishSettingsCertificatesToPersonalMachineStore() public method

Publishsettings file added to the machine store with the subcription id
public AddAllPublishSettingsCertificatesToPersonalMachineStore ( string subscriptionId = null ) : List
subscriptionId string
return List

AddPublishSettingsToPersonalMachineStore() public method

Takes an xml document and adds to a store
public AddPublishSettingsToPersonalMachineStore ( StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
location StoreLocation
return System.Security.Cryptography.X509Certificates.X509Certificate2

AddPublishSettingsToPersonalMachineStore() public static method

Adds a certificate to the local machine personal store
public static AddPublishSettingsToPersonalMachineStore ( string xml, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
xml string
location StoreLocation
return System.Security.Cryptography.X509Certificates.X509Certificate2

Extract() public method

Will extract a .publishsettings file certificate and then export as a .cer file
public Extract ( string fileNameOut ) : void
fileNameOut string
return void

ExtractCertObject() public method

Used to extract a certificate from a file
public ExtractCertObject ( System.IO.FileType type ) : X509Certificate2
type System.IO.FileType
return System.Security.Cryptography.X509Certificates.X509Certificate2

ExtractPfxObject() public method

Used to extract a pfk from a file
public ExtractPfxObject ( string password ) : X509Certificate2
password string
return System.Security.Cryptography.X509Certificates.X509Certificate2

FromStore() public static method

Checks through the CurrentUser and LocalMachine Personal and AuthRoot stores
public static FromStore ( string thumbprint, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
thumbprint string
location StoreLocation
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromFile() public method

Gets the certificate data from a file - can be a .cer file or publishsettings - exports the private key with the certificate
public GetCertificateFromFile ( string managementCertificate = null, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
managementCertificate string
location StoreLocation
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateFromXml() public static method

public static GetCertificateFromXml ( string xml, StoreLocation location = StoreLocation.CurrentUser ) : X509Certificate2
xml string
location StoreLocation
return System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertificateThumbprint() public method

Gets the certificate thumbprint value from the publishsettings xml
public GetCertificateThumbprint ( ) : string
return string

GetFromFile() public static method

Returns a PublishSettingsExtractor given a valid path
public static GetFromFile ( string file ) : PublishSettingsExtractor
file string
return PublishSettingsExtractor

GetFromXml() public static method

Returns a PublishSettingsExtractor given a valid xml document
public static GetFromXml ( string xml ) : PublishSettingsExtractor
xml string
return PublishSettingsExtractor

GetSubscriptions() public method

Gets a list of subscriptions in a .publishsettings file
public GetSubscriptions ( ) : List
return List

PublishSettingsExtractor() public method

Used to construct a publishsetting extractor class
public PublishSettingsExtractor ( string filePath, bool xmlContent = false ) : System
filePath string The filepath to the .publishsettings file
xmlContent bool Used to define whether the string is xml or a file
return System

RemoveFromStore() public static method

Remove a publishsettings file from the store
public static RemoveFromStore ( string thumbprint, StoreLocation location = StoreLocation.CurrentUser ) : void
thumbprint string The management certificate thumbprint
location StoreLocation
return void

this() public method

The indexer takes a subscription id string and returns a Subscription
public this ( string subscriptionId ) : Subscription
subscriptionId string
return Elastacloud.AzureManagement.Fluent.Types.Subscription