1.2.4 TCPAuthenticationContext Methods

The block reading and writing methods are unique to the TCP variant of the Authentication Context object because of the requirement that they operate only over a connected socket. These methods allow the sender to send arbitrarily large amounts of data with a single block_write and be assured that the receiver will allocate enough storage behind the scenes to complete the corresponding block read. These methods may raise socket.error on socket failures.

block_read ()
Read the what was sent by a corresponding block_write(), block_write_safe(), or block_write_priv() call. the return value is a tuple containing the type, of the corresponding write from the set: '', 'safe', 'priv', followed by the read data as a string object.

block_write (string)
Write the contents of the argument over the connected socket. corresponding block_read() will return the type followed by the read string in the form of a tuple. If string equals 'Hello World', than the corresponding block_read() will return ('', 'Hello World'). With type returned as the empty string, the indication is that no further Kerberos layer checking was performed apart from what was done during the call to the constructor send_auth() (initial handshake). This is the least secure and highest performing variant of the block write methods.

block_write_safe (string)
Write the contents of the argument over the connected socket. If string equals 'Hello World', then the corresponding block_read() will return the tuple: ('safe', 'Hello World'). With type returned as 'safe', the indication is that the block was checksummed and the checksum data encrypted for transport and that the decrypted checksum matched that of the data read. (i.e the block was not tampered with) The data itself, however, was passed in the clear.

block_write_priv (string)
Write the contents of the argument over the connected socket. If string equals 'Hello World', then the corresponding block_read() will return the tuple: ('priv', 'Hello World'). With type returned as 'priv', the indication is that the block was encrypted for transport and successfully decrypted on by the reader. This is the most secure and lowest performance variant of the block write methods.