Export (0) Print
Expand All

ServicePoint.Certificate Property

Gets the certificate received for this ServicePoint object.

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

public:
property X509Certificate^ Certificate {
	X509Certificate^ get ();
}
/** @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 == nullptr )
   Console::WriteLine( "Certificate = (null)" );
else
   Console::WriteLine( "Certificate = {0}", sp->Certificate );

if ( sp->ClientCertificate == nullptr )
   Console::WriteLine( "Client Certificate = (null)" );
else
   Console::WriteLine( "Client Certificate = {0}", sp->ClientCertificate );

Console::WriteLine( "ProtocolVersion = {0}", sp->ProtocolVersion->ToString() );
Console::WriteLine( "SupportsPipelining = {0}", sp->SupportsPipelining );


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