- certificate
- Documentation for this section has not yet been entered.
- targetHost
- Documentation for this section has not yet been entered.
Documentation for this section has not yet been entered.
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;
}