69 lines
2.4 KiB
C#
69 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Security.Cryptography.X509Certificates;
|
|
using System.Security;
|
|
|
|
|
|
namespace Intel.WebStorage
|
|
{
|
|
/// <summary>
|
|
/// Verifies the remote server certificate used for authentication.
|
|
/// </summary>
|
|
/// <param name="certificate">The certificate used to authenticate</param>
|
|
/// <param name="errors">One or more errors associated with the remote certificate.</param>
|
|
/// <returns>bool, determines whether the specified certificate is accepted for authentication.</returns>
|
|
public delegate bool ServerCertificateValidationCallback(X509Certificate certificate,
|
|
System.Net.Security.SslPolicyErrors errors);
|
|
|
|
/// <summary>
|
|
/// Represents various options for a Wsman connection
|
|
/// </summary>
|
|
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
|
[Guid("58A73241-12B8-4d6d-BA33-F8492A085E24")]
|
|
[ComVisible(true)]
|
|
public interface IWebStorageConnectionOptions
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the amount of time in milliseconds connection will
|
|
/// wait for responses from the server
|
|
/// </summary>
|
|
int TimeOut { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the proxy Address
|
|
/// </summary>
|
|
string ProxyAddress { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the proxy user name
|
|
/// </summary>
|
|
string ProxyUser { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the proxy password
|
|
/// </summary>
|
|
SecureString ProxyPassword { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the client certificate for mutual authentication from the Windows Certificate Store
|
|
/// </summary>
|
|
string ClientCertificateCommonName { get; set; }
|
|
|
|
/// <summary>
|
|
/// The certificate to use for establishing the connection.
|
|
/// To set this property by providing a certificate name string only, use the ClientCertificateCommonName property.
|
|
/// </summary>
|
|
X509Certificate2 ClientCertificate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the callback for custom validation by the client of the server certificate.
|
|
/// </summary>
|
|
ServerCertificateValidationCallback ServerCertificateValidationCallback { get; set; }
|
|
|
|
|
|
} // interface
|
|
|
|
}// end namespace
|