Class

NSURLCredential

NSURLCredential is an immutable object representing an authentication credential consisting of authentication information specific to the type of credential and the type of persistent storage to use, if any.

Overview

The URL loading system supports three types of credentials: password-based user credentials, certificate-based user credentials, and certificate-based server credentials (used when verifying the server’s identity).

When you create a credential, you can specify that it should be used for a single request, persisted temporarily (until your app quits), or persisted permanently (in the keychain).

Symbols

Creating a credential

+ credentialForTrust:

Creates and returns an NSURLCredential object for server trust authentication with a given accepted trust.

+ credentialWithUser:password:persistence:

Creates and returns an NSURLCredential object for internet password authentication with a given user name and password using a given persistence setting.

+ credentialWithIdentity:certificates:persistence:

Creates and returns an NSURLCredential object for client certificate authentication with a given identity and a given array of client certificates using a given persistence setting.

- initWithIdentity:certificates:persistence:

Returns an NSURLCredential object for client certificate authentication initialized with a given identity and a given array of client certificates using a given persistence setting.

- initWithTrust:

Returns an NSURLCredential object for server trust authentication initialized with a given accepted trust.

- initWithUser:password:persistence:

Returns an NSURLCredential object initialized with a given user name and password using a given persistence setting.

Getting credential properties

user

The receiver’s user name.

certificates

The certificates of the credential, if it is a client certificate credential.

hasPassword

A Boolean value that indicates whether the receiver has a password.

password

The receiver’s password.

identity

The identity of this credential if it is a client certificate credential.

persistence

The receiver’s persistence setting.

Constants

NSURLCredentialPersistence

These constants specify how long the credential will be kept.

Relationships

Inherits From