Export (0) Print
Expand All

ServicePoint.Certificate Property

Gets the certificate received for this ServicePoint object.

Namespace: System.Net
Assembly: System (in system.dll)

'Declaration
Public ReadOnly Property Certificate As X509Certificate
'Usage
Dim instance As ServicePoint
Dim value As X509Certificate

value = instance.Certificate

/** @property */
public X509Certificate get_Certificate ()

public function get Certificate () : X509Certificate

Property Value

An instance of the X509Certificate class that contains the security certificate received for this ServicePoint object.

Although a ServicePoint object can make multiple connections to an Internet resource, it can maintain only one certificate.

The following code example displays the value of this property.

If sp.Certificate Is Nothing Then
    Console.WriteLine("Certificate = (null)")
Else
    Console.WriteLine(("Certificate = " + sp.Certificate.ToString()))
End If

If sp.ClientCertificate Is Nothing Then
    Console.WriteLine("ClientCertificate = (null)")
Else
    Console.WriteLine(("ClientCertificate = " + sp.ClientCertificate.ToString()))
End If

Console.WriteLine("ProtocolVersion = " + sp.ProtocolVersion.ToString())
Console.WriteLine(("SupportsPipelining = " + sp.SupportsPipelining.ToString()))

if (sp.get_Certificate() == null) {
    Console.WriteLine("Certificate = (null)");
}
else {
    Console.WriteLine(("Certificate = " 
        + sp.get_Certificate().ToString()));
}

if (sp.get_ClientCertificate() == null) {
    Console.WriteLine("ClientCertificate = (null)");
}
else {
    Console.WriteLine(("ClientCertificate = " 
        + sp.get_ClientCertificate().ToString()));
}
Console.WriteLine(("ProtocolVersion = " 
    + sp.get_ProtocolVersion().ToString()));
Console.WriteLine(("SupportsPipelining = " 
    + sp.get_SupportsPipelining()));

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft