mscorlib(4.0.0.0) API with additions
System.Net.CredentialCache Class Reference

Provides storage for multiple credentials. More...

Inheritance diagram for System.Net.CredentialCache:
[legend]
Collaboration diagram for System.Net.CredentialCache:
[legend]

Public Member Functions

 CredentialCache ()
 Creates a new instance of the T:System.Net.CredentialCache class. More...
 
void Add (Uri uriPrefix, string authType, NetworkCredential cred)
 Adds a T:System.Net.NetworkCredential instance to the credential cache for use with protocols other than SMTP and associates it with a Uniform Resource Identifier (URI) prefix and authentication protocol. More...
 
void Add (string host, int port, string authenticationType, NetworkCredential credential)
 Adds a T:System.Net.NetworkCredential instance for use with SMTP to the credential cache and associates it with a host computer, port, and authentication protocol. Credentials added using this method are valid for SMTP only. This method does not work for HTTP or FTP requests. More...
 
void Remove (Uri uriPrefix, string authType)
 Deletes a T:System.Net.NetworkCredential instance from the cache if it is associated with the specified Uniform Resource Identifier (URI) prefix and authentication protocol. More...
 
void Remove (string host, int port, string authenticationType)
 Deletes a T:System.Net.NetworkCredential instance from the cache if it is associated with the specified host, port, and authentication protocol. More...
 
NetworkCredential GetCredential (Uri uriPrefix, string authType)
 Returns the T:System.Net.NetworkCredential instance associated with the specified Uniform Resource Identifier (URI) and authentication type. More...
 
NetworkCredential GetCredential (string host, int port, string authenticationType)
 Returns the T:System.Net.NetworkCredential instance associated with the specified host, port, and authentication protocol. More...
 
IEnumerator GetEnumerator ()
 Returns an enumerator that can iterate through the T:System.Net.CredentialCache instance. More...
 

Properties

static ICredentials DefaultCredentials [get]
 Gets the system credentials of the application. More...
 
static NetworkCredential DefaultNetworkCredentials [get]
 Gets the network credentials of the current security context. More...
 

Detailed Description

Provides storage for multiple credentials.

Definition at line 8 of file CredentialCache.cs.

Constructor & Destructor Documentation

◆ CredentialCache()

System.Net.CredentialCache.CredentialCache ( )

Creates a new instance of the T:System.Net.CredentialCache class.

Definition at line 103 of file CredentialCache.cs.

Member Function Documentation

◆ Add() [1/2]

void System.Net.CredentialCache.Add ( Uri  uriPrefix,
string  authType,
NetworkCredential  cred 
)

Adds a T:System.Net.NetworkCredential instance to the credential cache for use with protocols other than SMTP and associates it with a Uniform Resource Identifier (URI) prefix and authentication protocol.

Parameters
uriPrefixA T:System.Uri that specifies the URI prefix of the resources that the credential grants access to.
authTypeThe authentication scheme used by the resource named in uriPrefix .
credThe T:System.Net.NetworkCredential to add to the credential cache.
Exceptions
T:System.ArgumentNullExceptionuriPrefix is null. -or- authType is null.
T:System.ArgumentExceptionThe same credentials are added more than once.

Definition at line 116 of file CredentialCache.cs.

◆ Add() [2/2]

void System.Net.CredentialCache.Add ( string  host,
int  port,
string  authenticationType,
NetworkCredential  credential 
)

Adds a T:System.Net.NetworkCredential instance for use with SMTP to the credential cache and associates it with a host computer, port, and authentication protocol. Credentials added using this method are valid for SMTP only. This method does not work for HTTP or FTP requests.

Parameters
hostA T:System.String that identifies the host computer.
portA T:System.Int32 that specifies the port to connect to on host .
authenticationTypeA T:System.String that identifies the authentication scheme used when connecting to host using cred . See Remarks.
credentialThe T:System.Net.NetworkCredential to add to the credential cache.
Exceptions
T:System.ArgumentNullExceptionhost is null. -or- authType is null.
T:System.ArgumentExceptionauthType not an accepted value. See Remarks.
T:System.ArgumentOutOfRangeExceptionport is less than zero.

Definition at line 152 of file CredentialCache.cs.

◆ GetCredential() [1/2]

NetworkCredential System.Net.CredentialCache.GetCredential ( Uri  uriPrefix,
string  authType 
)

Returns the T:System.Net.NetworkCredential instance associated with the specified Uniform Resource Identifier (URI) and authentication type.

Parameters
uriPrefixA T:System.Uri that specifies the URI prefix of the resources that the credential grants access to.
authTypeThe authentication scheme used by the resource named in uriPrefix .
Returns
A T:System.Net.NetworkCredential or, if there is no matching credential in the cache, null.
Exceptions
T:System.ArgumentNullExceptionuriPrefix or authType is null.

Implements System.Net.ICredentials.

Definition at line 227 of file CredentialCache.cs.

◆ GetCredential() [2/2]

NetworkCredential System.Net.CredentialCache.GetCredential ( string  host,
int  port,
string  authenticationType 
)

Returns the T:System.Net.NetworkCredential instance associated with the specified host, port, and authentication protocol.

Parameters
hostA T:System.String that identifies the host computer.
portA T:System.Int32 that specifies the port to connect to on host .
authenticationTypeA T:System.String that identifies the authentication scheme used when connecting to host . See Remarks.
Returns
A T:System.Net.NetworkCredential or, if there is no matching credential in the cache, null.
Exceptions
T:System.ArgumentNullExceptionhost is null. -or- authType is null.
T:System.ArgumentExceptionauthType not an accepted value. See Remarks. -or- host is equal to the empty string ("").
T:System.ArgumentOutOfRangeExceptionport is less than zero.

Implements System.Net.ICredentialsByHost.

Definition at line 270 of file CredentialCache.cs.

◆ GetEnumerator()

IEnumerator System.Net.CredentialCache.GetEnumerator ( )

Returns an enumerator that can iterate through the T:System.Net.CredentialCache instance.

Returns
An T:System.Collections.IEnumerator for the T:System.Net.CredentialCache.

Implements System.Collections.IEnumerable.

Definition at line 304 of file CredentialCache.cs.

◆ Remove() [1/2]

void System.Net.CredentialCache.Remove ( Uri  uriPrefix,
string  authType 
)

Deletes a T:System.Net.NetworkCredential instance from the cache if it is associated with the specified Uniform Resource Identifier (URI) prefix and authentication protocol.

Parameters
uriPrefixA T:System.Uri that specifies the URI prefix of the resources that the credential is used for.
authTypeThe authentication scheme used by the host named in uriPrefix .

Definition at line 187 of file CredentialCache.cs.

◆ Remove() [2/2]

void System.Net.CredentialCache.Remove ( string  host,
int  port,
string  authenticationType 
)

Deletes a T:System.Net.NetworkCredential instance from the cache if it is associated with the specified host, port, and authentication protocol.

Parameters
hostA T:System.String that identifies the host computer.
portA T:System.Int32 that specifies the port to connect to on host .
authenticationTypeA T:System.String that identifies the authentication scheme used when connecting to host . See Remarks.

Definition at line 206 of file CredentialCache.cs.

Property Documentation

◆ DefaultCredentials

ICredentials System.Net.CredentialCache.DefaultCredentials
staticget

Gets the system credentials of the application.

Returns
An T:System.Net.ICredentials that represents the system credentials of the application.

Definition at line 79 of file CredentialCache.cs.

◆ DefaultNetworkCredentials

NetworkCredential System.Net.CredentialCache.DefaultNetworkCredentials
staticget

Gets the network credentials of the current security context.

Returns
An T:System.Net.NetworkCredential that represents the network credentials of the current user or application.

Definition at line 92 of file CredentialCache.cs.


The documentation for this class was generated from the following file: