Skip to content

Instance Method

handle(message:sender:)

Handle an incoming message via the provided mechanism. The sender closure will be invoked with any data that should be transmitted to the other side of the negotiation. An error thrown from the closure will immediately result in an authentication failure state. The closure may be invoked even if authentication otherwise fails (such as for mechanisms which send failure responses). On authentication failure, an error is thrown. Otherwise, true is returned to indicate that authentication has successfully completed. false is returned to indicate that further steps are required by the current mechanism.
func handle(message: [UInt8]?, sender: ([UInt8]) throws -> Void) throws -> Bool

Discussion

Pass a nil message to start the initial request from a client. It is invalid to do this for a server.