authenticationDataForComponents:
Returns an NSData object to be used as an authentication stamp for an outgoing message.
Declaration
- (NSData *) authenticationDataForComponents:(NSArray *) components;Parameters
- components:
An array containing the elements of a network message, in the form of
NSPortandNSDataobjects.
Return Value
An NSData object to be used as an authentication stamp for an outgoing message.
Discussion
The delegate should use only the NSData elements to create the authentication stamp. See the PortMessage class specification for more information on the components.
If authenticationDataForComponents: returns nil, an NSGenericException will be raised. If the delegate determines that the message shouldn’t be authenticated, it should return an empty NSData object. The delegate on the other side of the connection must then be prepared to accept an empty NSData object as the second parameter to authenticateComponents:withData: and to handle the situation appropriately.
The components parameter will be validated on receipt by the delegate of the peer NSConnection object with authenticateComponents:withData:.