Up

# NSURLCredentialStorage class documentation

### Authors

Generated by Debian

# Software documentation for the NSURLCredentialStorage class

## NSURLCredentialStorage : NSObject

> Declared in:
>   Foundation/NSURLCredentialStorage.h

Availability: MacOS-X 10.2.0, Base 1.13.0
Provides shared storage of credentials.

Instance Variables
Method summary

- +sharedCredentialStorage
- -allCredentials
- -credentialsForProtectionSpace:
- -defaultCredentialForProtectionSpace:
- -removeCredential:forProtectionSpace:
- -setCredential:forProtectionSpace:
- -setDefaultCredential:forProtectionSpace:

### sharedCredentialStorage

+ (NSURLCredentialStorage*) sharedCredentialStorage;
Availability: MacOS-X 10.2.0, Base 1.13.0
Return the shared credential storage object.

### allCredentials

- (NSDictionary*) allCredentials;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns a dictionary of dictionaries... with NSURLProtectionSpace objects as the keys in the outer dictionary, and values which are dictionaries of the credentails within each protection space.

### credentialsForProtectionSpace:

- (NSDictionary*) credentialsForProtectionSpace: (NSURLProtectionSpace*)space;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns a dictionary mapping usernames to credentials for the specified protection space.
Each username is a unique identifier for a credential within a protection space.

### defaultCredentialForProtectionSpace:

- (NSURLCredential*) defaultCredentialForProtectionSpace: (NSURLProtectionSpace*)space;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the default credential for the specified protection space, or `nil` if none is set.

### removeCredential: forProtectionSpace:

- (void) removeCredential: (NSURLCredential*)credential forProtectionSpace: (NSURLProtectionSpace*)space;
Availability: MacOS-X 10.2.0, Base 1.13.0
Removes the credential from both in-memory and persistent storage for the specified protection space.

### setCredential: forProtectionSpace:

- (void) setCredential: (NSURLCredential*)credential forProtectionSpace: (NSURLProtectionSpace*)space;
Availability: MacOS-X 10.2.0, Base 1.13.0
Sets credential in the storage for the protection space specified.
This replaces any old value with the same username.

### setDefaultCredential: forProtectionSpace:

- (void) setDefaultCredential: (NSURLCredential*)credential forProtectionSpace: (NSURLProtectionSpace*)space;
Availability: MacOS-X 10.2.0, Base 1.13.0
Sets the default credential for the protection space. Also calls -setCredential:forProtectionSpace: if the credential has not already been set in space.

## Instance Variables for NSURLCredentialStorage Class

### _NSURLCredentialStorageInternal

@protected void* _NSURLCredentialStorageInternal;
Availability: MacOS-X 10.2.0, Base 1.13.0
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

Up