Type Method

credentialForTrust:

Creates a URL credential instance for server trust authentication with a given accepted trust.

Declaration

+ (NSURLCredential *)credentialForTrust:(SecTrustRef)trust;

Parameters

trust

The accepted trust.

Return Value

A new URL credential object, containing the accepted server trust.

Discussion

Before creating a server trust credential, it is the responsibility of the delegate of an NSURLConnection instance or an NSURLDownload instance to evaluate the trust. Do this by calling SecTrustEvaluate, passing it the trust obtained from the serverTrust method of the server’s NSURLProtectionSpace instance. If the trust is invalid, the authentication challenge should be cancelled with cancelAuthenticationChallenge:.

See Also

Creating a Credential

+ credentialWithUser:password:persistence:

Creates a URL credential instance for internet password authentication with a given user name and password, using a given persistence setting.

+ credentialWithIdentity:certificates:persistence:

Creates a URL credential instance for resolving a client certificate authentication challenge.

- initWithIdentity:certificates:persistence:

Creates a URL credential instance for resolving a client certificate authentication challenge.

- initWithTrust:

Creates a URL credential instance for server trust authentication, initialized with a accepted trust.

- initWithUser:password:persistence:

Creates a URL credential instance initialized with a given user name and password, using a given persistence setting.

NSURLCredentialPersistence

Constants that specify how long the credential will be kept.