using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System.Security.Cryptography.X509Certificates; using System.Security; namespace Intel.Management.Wsman { /// /// Verifies the remote server certificate used for authentication. /// /// The certificate used to authenticate /// One or more errors associated with the remote certificate. /// bool, determines whether the specified certificate is accepted for authentication. public delegate bool ServerCertificateValidationCallback(X509Certificate certificate, System.Net.Security.SslPolicyErrors errors); /// /// Represents various options for a Wsman connection /// [InterfaceType(ComInterfaceType.InterfaceIsDual)] [Guid("58A73241-12B8-4d6d-BA33-F8492A085E24")] [ComVisible(true)] public interface IWsmanConnectionOptions: IDisposable { /// /// Gets or sets the amount of time in milliseconds connection will /// wait for responses from the server /// int Timeout { get; set; } /// /// Gets or sets max number of items the connection can recieve when pulling data /// int MaxElements { get; set; } /// /// Gets or sets the proxy Address /// string ProxyAddress { get; set; } /// /// Gets or sets the proxy user name /// string ProxyUser { get; set; } /// /// Gets or sets the proxy password /// SecureString ProxyPassword { get; set; } /// /// Gets or sets the client certificate for mutual authentication /// X509Certificate ClientCertificate { get; set; } /// /// Gets or sets the connection Service Principle Name /// string ServiceName { get; set; } /// /// Gets or sets a value that indicates whether to verify certificates during TLS operations /// bool VerifyCertificates { get; set; } /// /// Gets or sets a value that indicates whether to accept self-signed certificate and skip any certificate check /// bool AcceptSelfSignedCertificate { get; set; } /// /// Gets or sets a value that indicates whether to treat the Password as a master password /// bool UseDigestMasterPassword { get; set; } /// /// Gets or sets a value that indicates whether to hide the password /// bool HidePassword { get; set; } /// /// Gets or sets a value that indicates the Internet Protocol to use /// InternetProtocolType InternetProtocol { get; set; } /// /// Gets or sets the callback for custom validation by the client of the server certificate. /// ServerCertificateValidationCallback ServerCertificateValidationCallback { get; set; } /// /// Sets the client certificate to be used in the connection by giving the certificate name. /// ///The certificate name. void SetClientCertificateByCertificateName(string clientCert); } // interface /// /// The Type of Internet protocol to use /// public enum InternetProtocolType { /// /// Use IPv4 Protocol /// IPv4 = 4, /// /// Use IPv6 Protocol /// Ipv6 = 6, } }// end namespace