mscorlib(4.0.0.0) API with additions
System.Net.Security Namespace Reference

Classes

class  AuthenticatedStream
 Provides methods for passing credentials across a stream and requesting or performing authentication for client-server applications. More...
 
class  NegotiateStream
 Provides a stream that uses the Negotiate security protocol to authenticate the client, and optionally the server, in client-server communication. More...
 
class  SslStream
 Provides a stream used for client-server communication that uses the Secure Socket Layer (SSL) security protocol to authenticate the server and optionally the client. More...
 

Enumerations

enum  AuthenticationLevel { AuthenticationLevel.None, AuthenticationLevel.MutualAuthRequested, AuthenticationLevel.MutualAuthRequired }
 Specifies client requirements for authentication and impersonation when using the T:System.Net.WebRequest class and derived classes to request a resource. More...
 
enum  EncryptionPolicy { EncryptionPolicy.RequireEncryption, EncryptionPolicy.AllowNoEncryption, EncryptionPolicy.NoEncryption }
 The EncryptionPolicy to use. More...
 
enum  ProtectionLevel { ProtectionLevel.None, ProtectionLevel.Sign, ProtectionLevel.EncryptAndSign }
 Indicates the security services requested for an authenticated stream. More...
 
enum  SslPolicyErrors { SslPolicyErrors.None = 0x0, SslPolicyErrors.RemoteCertificateNotAvailable = 0x1, SslPolicyErrors.RemoteCertificateNameMismatch = 0x2, SslPolicyErrors.RemoteCertificateChainErrors = 0x4 }
 Enumerates Secure Socket Layer (SSL) policy errors. More...
 
enum  TlsAlertMessage {
  CloseNotify = 0, UnexpectedMessage = 10, BadRecordMac = 20, DecryptionFailed = 21,
  RecordOverflow = 22, DecompressionFail = 30, HandshakeFailure = 40, BadCertificate = 42,
  UnsupportedCert = 43, CertificateRevoked = 44, CertificateExpired = 45, CertificateUnknown = 46,
  IllegalParameter = 47, UnknownCA = 48, AccessDenied = 49, DecodeError = 50,
  DecryptError = 51, ExportRestriction = 60, ProtocolVersion = 70, InsuffientSecurity = 71,
  InternalError = 80, UserCanceled = 90, NoRenegotiation = 100, UnsupportedExt = 110
}
 
enum  TlsAlertType { Warning = 1, Fatal }
 

Functions

delegate X509Certificate LocalCertificateSelectionCallback (object sender, string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
 Selects the local Secure Sockets Layer (SSL) certificate used for authentication. More...
 
internal delegate X509Certificate LocalCertSelectionCallback (string targetHost, X509CertificateCollection localCertificates, X509Certificate remoteCertificate, string[] acceptableIssuers)
 
delegate bool RemoteCertificateValidationCallback (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
 Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication. More...
 
internal delegate bool RemoteCertValidationCallback (string host, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
 

Enumeration Type Documentation

◆ AuthenticationLevel

Specifies client requirements for authentication and impersonation when using the T:System.Net.WebRequest class and derived classes to request a resource.

Enumerator
None 

No authentication is required for the client and server.

MutualAuthRequested 

The client and server should be authenticated. The request does not fail if the server is not authenticated. To determine whether mutual authentication occurred, check the value of the P:System.Net.WebResponse.IsMutuallyAuthenticated property.

MutualAuthRequired 

The client and server should be authenticated. If the server is not authenticated, your application will receive an T:System.IO.IOException with a T:System.Net.ProtocolViolationException inner exception that indicates that mutual authentication failed

Definition at line 5 of file AuthenticationLevel.cs.

◆ EncryptionPolicy

The EncryptionPolicy to use.

Enumerator
RequireEncryption 

Require encryption and never allow a NULL cipher.

AllowNoEncryption 

Prefer that full encryption be used, but allow a NULL cipher (no encryption) if the server agrees.

NoEncryption 

Allow no encryption and request that a NULL cipher be used if the other endpoint can handle a NULL cipher.

Definition at line 4 of file EncryptionPolicy.cs.

◆ ProtectionLevel

Indicates the security services requested for an authenticated stream.

Enumerator
None 

Authentication only.

Sign 

Sign data to help ensure the integrity of transmitted data.

EncryptAndSign 

Encrypt and sign data to help ensure the confidentiality and integrity of transmitted data.

Definition at line 4 of file ProtectionLevel.cs.

◆ SslPolicyErrors

Enumerates Secure Socket Layer (SSL) policy errors.

Enumerator
None 

No SSL policy errors.

RemoteCertificateNotAvailable 

Certificate not available.

RemoteCertificateNameMismatch 

Certificate name mismatch.

RemoteCertificateChainErrors 

P:System.Security.Cryptography.X509Certificates.X509Chain.ChainStatus has returned a non empty array.

Definition at line 6 of file SslPolicyErrors.cs.

Function Documentation

◆ LocalCertificateSelectionCallback()

delegate X509Certificate System.Net.Security.LocalCertificateSelectionCallback ( object  sender,
string  targetHost,
X509CertificateCollection  localCertificates,
X509Certificate  remoteCertificate,
string []  acceptableIssuers 
)

Selects the local Secure Sockets Layer (SSL) certificate used for authentication.

Parameters
senderAn object that contains state information for this validation.
targetHostThe host server specified by the client.
localCertificatesAn T:System.Security.Cryptography.X509Certificates.X509CertificateCollection containing local certificates.
remoteCertificateThe certificate used to authenticate the remote party.
acceptableIssuersA T:System.String array of certificate issuers acceptable to the remote party.
Returns
An T:System.Security.Cryptography.X509Certificates.X509Certificate used for establishing an SSL connection.

◆ RemoteCertificateValidationCallback()

delegate bool System.Net.Security.RemoteCertificateValidationCallback ( object  sender,
X509Certificate  certificate,
X509Chain  chain,
SslPolicyErrors  sslPolicyErrors 
)

Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication.

Parameters
senderAn object that contains state information for this validation.
certificateThe certificate used to authenticate the remote party.
chainThe chain of certificate authorities associated with the remote certificate.
sslPolicyErrorsOne or more errors associated with the remote certificate.
Returns
A T:System.Boolean value that determines whether the specified certificate is accepted for authentication.