C# Класс Opc.Ua.Configuration.ApplicationInstance

A class that install, configures and runs a UA application.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddToDiscoveryServerTrustList ( X509Certificate2 certificate, string oldThumbprint, IList issuers, CertificateStoreIdentifier trustedCertificateStore ) : void

Adds the application certificate to the discovery server trust list.

ApplicationInstance ( ) : System

Initializes a new instance of the ApplicationInstance class.

ApplicationInstance ( ApplicationConfiguration applicationConfiguration ) : System

Initializes a new instance of the ApplicationInstance class.

CheckApplicationInstanceCertificate ( bool silent, ushort minimumKeySize ) : void

Checks for a valid application instance certificate.

GetHttpUrlForAccessRule ( string baseAddress ) : string

Gets the HTTP URL to use for HTTP access rules.

LoadAppConfig ( bool silent, string filePath, ApplicationType applicationType, Type configurationType, bool applyTraceSettings ) : ApplicationConfiguration

Loads the configuration.

LoadApplicationConfiguration ( bool silent ) : ApplicationConfiguration

Loads the application configuration.

LoadApplicationConfiguration ( string filePath, bool silent ) : ApplicationConfiguration

Loads the application configuration.

LoadInstallConfig ( string configFile ) : void

Loads the installation configuration.

LoadInstallConfigFromFile ( string filePath ) : InstalledApplication

Loads the installation configuration from a file.

LoadInstallConfigFromResource ( string resourcePath, Assembly assembly ) : InstalledApplication

Loads the installation configuration from an embedded resource.

LoadInstallConfigFromStream ( Stream istrm ) : InstalledApplication

Loads the installation configuration from a stream.

ProcessCommandLine ( ) : bool

Processes the command line.

ProcessCommandLine ( bool ignoreUnknownArguments ) : bool

Processes the command line.

SetUaValidationForHttps ( CertificateValidator validator ) : void

Uses the UA validation logic for HTTPS certificates.

Start ( ServerBase server ) : void

Starts the UA server.

StartAsService ( ServerBase server ) : void

Starts the UA server as a Windows Service.

Stop ( ) : void

Stops the UA server.

Защищенные методы

Метод Описание
GetArgumentDescriptions ( ) : ArgumentDescription[]

Gets the descriptions for the supported arguments.

GetHelpString ( ArgumentDescription commands ) : string

Gets the help string.

Install ( bool silent, string>.Dictionary args ) : void

Installs the service.

OnBeforeInstallService ( ) : void

Called immediately before the service is installed.

ProcessCommand ( bool silent, string>.Dictionary args ) : bool

Processes the command.

Uninstall ( bool silent, string>.Dictionary args ) : void

Uninstalls the service.

UpdateAppConfigWithInstallConfig ( ApplicationConfiguration configuration ) : void

Updates the application configuration with the values from the installation configuration.

ValidateArguments ( bool ignoreUnknownArguments, string>.Dictionary args ) : string

Validates the arguments.

Приватные методы

Метод Описание
AddApplicationCertificateToStore ( CertificateStoreIdentifier csid, X509Certificate2 certificate, string oldThumbprint ) : void

Adds an application certificate to a store.

AddIssuerCertificatesToStore ( CertificateStoreIdentifier csid, IList issuers ) : void

Adds an application certificate to a store.

AddToTrustedStore ( ApplicationConfiguration configuration, X509Certificate2 certificate ) : void

Adds the certificate to the Trusted Certificate Store

CertificateValidator_CertificateValidation ( CertificateValidator validator, CertificateValidationEventArgs e ) : void

Handles a certificate validation error.

CheckApplicationInstanceCertificate ( ApplicationConfiguration configuration, X509Certificate2 certificate, bool silent, ushort minimumKeySize ) : bool

Creates an application instance certificate if one does not already exist.

CheckDomainsInCertificate ( ApplicationConfiguration configuration, X509Certificate2 certificate, bool silent ) : bool

Checks that the domains in the server addresses match the domains in the certificates.

ConfigureFileAccess ( ApplicationConfiguration configuration ) : void

Configures access to the executable, the configuration file and the private key.

ConfigureFirewall ( ApplicationConfiguration configuration, bool silent, bool remove ) : void

Configures the firewall.

ConfigureHttpAccess ( ApplicationConfiguration configuration, bool remove ) : void

Configures the HTTP access.

CreateApplicationInstanceCertificate ( ApplicationConfiguration configuration, ushort keySize, ushort lifetimeInMonths ) : X509Certificate2

Creates the application instance certificate.

DeleteApplicationInstanceCertificate ( ApplicationConfiguration configuration ) : void

Deletes an existing application instance certificate.

GetAccessRules ( ) : List

Gets the access rules to use for the application.

HttpsCertificateValidation ( object sender, X509Certificate cert, X509Chain chain, System error ) : bool

Remotes the certificate validate.

SetHttpAccessRules ( string url, bool remove ) : void

Sets the HTTP access rules for the URL.

Описание методов

AddToDiscoveryServerTrustList() публичный статический Метод

Adds the application certificate to the discovery server trust list.
public static AddToDiscoveryServerTrustList ( X509Certificate2 certificate, string oldThumbprint, IList issuers, CertificateStoreIdentifier trustedCertificateStore ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
oldThumbprint string
issuers IList
trustedCertificateStore CertificateStoreIdentifier
Результат void

ApplicationInstance() публичный Метод

Initializes a new instance of the ApplicationInstance class.
public ApplicationInstance ( ) : System
Результат System

ApplicationInstance() публичный Метод

Initializes a new instance of the ApplicationInstance class.
public ApplicationInstance ( ApplicationConfiguration applicationConfiguration ) : System
applicationConfiguration ApplicationConfiguration The application configuration.
Результат System

CheckApplicationInstanceCertificate() публичный Метод

Checks for a valid application instance certificate.
public CheckApplicationInstanceCertificate ( bool silent, ushort minimumKeySize ) : void
silent bool if set to true no dialogs will be displayed.
minimumKeySize ushort Minimum size of the key.
Результат void

GetArgumentDescriptions() защищенный Метод

Gets the descriptions for the supported arguments.
protected GetArgumentDescriptions ( ) : ArgumentDescription[]
Результат ArgumentDescription[]

GetHelpString() защищенный Метод

Gets the help string.
protected GetHelpString ( ArgumentDescription commands ) : string
commands ArgumentDescription
Результат string

GetHttpUrlForAccessRule() публичный статический Метод

Gets the HTTP URL to use for HTTP access rules.
public static GetHttpUrlForAccessRule ( string baseAddress ) : string
baseAddress string
Результат string

Install() защищенный Метод

Installs the service.
protected Install ( bool silent, string>.Dictionary args ) : void
silent bool if set to true no dialogs such be displayed.
args string>.Dictionary Additional arguments provided on the command line.
Результат void

LoadAppConfig() публичный статический Метод

Loads the configuration.
public static LoadAppConfig ( bool silent, string filePath, ApplicationType applicationType, Type configurationType, bool applyTraceSettings ) : ApplicationConfiguration
silent bool
filePath string
applicationType ApplicationType
configurationType System.Type
applyTraceSettings bool
Результат ApplicationConfiguration

LoadApplicationConfiguration() публичный Метод

Loads the application configuration.
public LoadApplicationConfiguration ( bool silent ) : ApplicationConfiguration
silent bool
Результат ApplicationConfiguration

LoadApplicationConfiguration() публичный Метод

Loads the application configuration.
public LoadApplicationConfiguration ( string filePath, bool silent ) : ApplicationConfiguration
filePath string
silent bool
Результат ApplicationConfiguration

LoadInstallConfig() публичный Метод

Loads the installation configuration.
public LoadInstallConfig ( string configFile ) : void
configFile string The config file (may be null).
Результат void

LoadInstallConfigFromFile() публичный Метод

Loads the installation configuration from a file.
public LoadInstallConfigFromFile ( string filePath ) : InstalledApplication
filePath string
Результат InstalledApplication

LoadInstallConfigFromResource() публичный Метод

Loads the installation configuration from an embedded resource.
public LoadInstallConfigFromResource ( string resourcePath, Assembly assembly ) : InstalledApplication
resourcePath string
assembly System.Reflection.Assembly
Результат InstalledApplication

LoadInstallConfigFromStream() публичный Метод

Loads the installation configuration from a stream.
public LoadInstallConfigFromStream ( Stream istrm ) : InstalledApplication
istrm Stream
Результат InstalledApplication

OnBeforeInstallService() защищенный Метод

Called immediately before the service is installed.
protected OnBeforeInstallService ( ) : void
Результат void

ProcessCommand() защищенный Метод

Processes the command.
protected ProcessCommand ( bool silent, string>.Dictionary args ) : bool
silent bool if set to true no dialogs such be displayed.
args string>.Dictionary Additional arguments provided on the command line.
Результат bool

ProcessCommandLine() публичный Метод

Processes the command line.
public ProcessCommandLine ( ) : bool
Результат bool

ProcessCommandLine() публичный Метод

Processes the command line.
public ProcessCommandLine ( bool ignoreUnknownArguments ) : bool
ignoreUnknownArguments bool if set to true unknown arguments are ignored.
Результат bool

SetUaValidationForHttps() публичный статический Метод

Uses the UA validation logic for HTTPS certificates.
public static SetUaValidationForHttps ( CertificateValidator validator ) : void
validator CertificateValidator The validator.
Результат void

Start() публичный Метод

Starts the UA server.
public Start ( ServerBase server ) : void
server ServerBase The server.
Результат void

StartAsService() публичный Метод

Starts the UA server as a Windows Service.
public StartAsService ( ServerBase server ) : void
server ServerBase The server.
Результат void

Stop() публичный Метод

Stops the UA server.
public Stop ( ) : void
Результат void

Uninstall() защищенный Метод

Uninstalls the service.
protected Uninstall ( bool silent, string>.Dictionary args ) : void
silent bool if set to true no dialogs such be displayed.
args string>.Dictionary Additional arguments provided on the command line.
Результат void

UpdateAppConfigWithInstallConfig() защищенный Метод

Updates the application configuration with the values from the installation configuration.
protected UpdateAppConfigWithInstallConfig ( ApplicationConfiguration configuration ) : void
configuration ApplicationConfiguration The configuration to update.
Результат void

ValidateArguments() защищенный Метод

Validates the arguments.
protected ValidateArguments ( bool ignoreUnknownArguments, string>.Dictionary args ) : string
ignoreUnknownArguments bool
args string>.Dictionary
Результат string