Initializer

init(identity:certificates:persistence:)

Creates a URL credential instance for resolving a client certificate authentication challenge. URL資格情報インスタンスを、あるクライアント証明書認証チャレンジを解決するために作成します。

Declaration 宣言

init(identity: SecIdentity, 
certificates certArray: [Any]?, 
persistence: URLCredential.Persistence)

Parameters パラメータ

identity

The identity for the credential. この資格情報に対するidentity。

certArray

An array of one or more SecCertificateRef objects representing intermediate certificates leading from the identity’s certificate to a trusted root, or nil if the server does not need any intermediate certificates to authenticate the client. identityのもつ証明書から、ある信用されるrootまで導く中間証明書を表している1つ以上のSecCertificateRefオブジェクトからなるある配列、またはnil、もしサーバーがどんな中間証明書もクライアントを認証するのに必要としないならば。

persistence

The method ignores this parameter; you should supply a value of URLCredential.Persistence.forSession because that most accurately reflects the actual behaviour. メソッドはこのパラメータを無視します;あなたはURLCredential.Persistence.forSessionの値を提供すべきです、なぜならそれが最も正確に実際の挙動を反映するからです。

Return Value 戻り値

A new URL credential object, using the provided identity and, optionally, an array of intermediate certificates. 新しいURL資格情報オブジェクト、それは提供されたidentityそして、随意に、中間証明書それらからなるある配列。

Discussion 議論

When you receive a client certificate authentication challenge (NSURLAuthenticationMethodClientCertificate) and want to resolve it successfully, you must supply a credential created using this initializer. あなたがあるクライアント証明書認証チャレンジ(NSURLAuthenticationMethodClientCertificate)を受け取り、そしてそれを成功裏に解決したいならば、あなたはこのイニシャライザを使って作成される資格情報を提供しなければなりません。

In most cases you should pass nil to the certArray parameter. You only need to supply an array of intermediate certificates if the server needs those intermediate certificates to authenticate the client. Typically this isn’t necessary because the server already has a copy of the relevant intermediate certificates. ほとんどの場合にあなたはnilcertArrayパラメータに渡すべきです。唯一あなたが中間証明書からなる配列を提供する必要があるのは、サーバーがそれら中間証明書をクライアントを認証するのに必要とする場合です。概してこれは必須ではありません、なぜならサーバーは関連する中間証明書のコピーをすでに持つからです。

See Also 参照

Creating a Credential 資格情報を作成する