def __init__(self, negotiate_flags, exported_session_key, source="<STR_LIT>"):
self.negotiate_flags = negotiate_flags<EOL>self.exported_session_key = exported_session_key<EOL>self.outgoing_seq_num = <NUM_LIT:0><EOL>self.incoming_seq_num = <NUM_LIT:0><EOL>client_sealing_key =compkeys.get_seal_key(self.negotiate_flags, exported_session_key,<EOL>SignSealConstants.CLIENT_SEALING)<EOL>server_sealing_key =compkeys.get_seal_key(self.negotiate_flags, exported_session_key,<EOL>SignSealConstants.SERVER_SEALING)<EOL>if source == "<STR_LIT>":<EOL><INDENT>self.outgoing_signing_key =compkeys.get_sign_key(exported_session_key,<EOL>SignSealConstants.CLIENT_SIGNING)<EOL>self.incoming_signing_key =compkeys.get_sign_key(exported_session_key,<EOL>SignSealConstants.SERVER_SIGNING)<EOL>self.outgoing_handle = ARC4(client_sealing_key)<EOL>self.incoming_handle = ARC4(server_sealing_key)<EOL><DEDENT>elif source == "<STR_LIT>":<EOL><INDENT>self.outgoing_signing_key =compkeys.get_sign_key(exported_session_key,<EOL>SignSealConstants.SERVER_SIGNING)<EOL>self.incoming_signing_key =compkeys.get_sign_key(exported_session_key,<EOL>SignSealConstants.CLIENT_SIGNING)<EOL>self.outgoing_handle = ARC4(server_sealing_key)<EOL>self.incoming_handle = ARC4(client_sealing_key)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>" % source)<EOL><DEDENT>
Initialises a security session context that can be used by libraries
that call ntlm-auth to sign and seal messages send to the server as
well as verify and unseal messages that have been received from the
server. This is similar to the GSS_Wrap functions specified in the
MS-NLMP document which does the same task.

:param negotiate_flags: The negotiate flag structure that has been
    negotiated with the server
:param exported_session_key: A 128-bit session key used to derive
    signing and sealing keys
:param source: The source of the message, only used in test scenarios
    when testing out a server sealing and unsealing