provideIdentity(for:completionHandler:)
Provide the identity and an optional certificate chain to be used for authentication.
Declaration
optional func provideIdentity(for connection: NWTCPConnection, completionHandler completion: @escaping (SecIdentity, [Any]) -> Void)Parameters
- connection:
The connection sending this message
- completion:
The completion handler for passing an identity and certificate chain to the connection. The
identityis required and must not benil. ThecertificateChainargument is optional, and is an array of one or more Seccertificate objects. The certificate chain must contain objects of typeSecCertificateRefonly. If the certificate chain is set, it will be used. Otherwise, the leaf certificate will be extracted from the Secidentity object and will be used for authentication.The caller is responsible for keeping the argument object(s) valid for the duration of the completion handler invocation.
Discussion
Optional. If this method is not implemented, the default certificate evaluation will be used.