'Encrypt the message read from the file-like object \'file\''

def encrypt_file(self, file, recipients, sign=None, always_trust=False, passphrase=None, armor=True, output=None, symmetric=False):

    args = ['--no-version', "--comment    ''"]
    if symmetric:
        args.append('--symmetric')
    else:
        args.append('--encrypt')
        if (not _is_sequence(recipients)):
            recipients = (recipients,)
        for recipient in recipients:
            args.append(('--recipient    "%s"' % recipient))
    if armor:
        args.append('--armor')
    if output:
        if os.path.exists(output):
            os.remove(output)
        args.append(('--output    "%s"' % output))
    if sign:
        args.append(('--sign    --default-key    "%s"' % sign))
    if always_trust:
        args.append('--always-trust')
    result = self.result_map['crypt'](self)
    self._handle_io(args, file, result, passphrase=passphrase, binary=True)
    logger.debug('encrypt    result:    %r', result.data)
    return result
