Mono.Security.Protocol.Tls.PrivateKeySelectionCallback Delegate
Type of the method that can find the private key associated with a specific X.509 certificate and a host name.

Syntax

public delegate System.Security.Cryptography.AsymmetricAlgorithm PrivateKeySelectionCallback (System.Security.Cryptography.X509Certificates.X509Certificate certificate, string targetHost)

Parameters

certificate
Documentation for this section has not yet been entered.
targetHost
Documentation for this section has not yet been entered.

Value

Documentation for this section has not yet been entered.

Remarks

First we assign a method to select a private key.

C# Example

	// ... initialize the NetworkStream, get the X.509 certificate ...
	using (SslServerStream s = new SslServerStream (ns, certificate, false, false)) { 
		s.PrivateKeyCertSelectionDelegate += new PrivateKeySelectionCallback (GetPrivateKey); 
	} 
  

The method has the certificate and the name of the target host to find the appropriate private key.

C# Example

          private static AsymmetricAlgorithm GetPrivateKey (X509Certificate certificate, string targetHost) 
          { 
               PrivateKey key = PrivateKey.CreateFromFile (targetHost + ".pvk"); 
               return key.RSA; 
          } 
  

Requirements

Namespace: Mono.Security.Protocol.Tls
Assembly: Mono.Security (in Mono.Security.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0