'Check if the connection is encrypted in the given direction.
@type direction: L{str}
@param direction: The direction: one of \'out\', \'in\', or \'both\'.
@rtype: L{bool}
@return: C{True} if it is encrypted.'

def isEncrypted(self, direction='out'):

    if (direction == 'out'):
        return (self.currentEncryptions.outCipType != 'none')
    elif (direction == 'in'):
        return (self.currentEncryptions.inCipType != 'none')
    elif (direction == 'both'):
        return (self.isEncrypted('in') and self.isEncrypted('out'))
    else:
        raise TypeError('direction    must    be    "out",    "in",    or    "both"')
