if encrypt and not key.can_encrypt:
        raise GPGProblem(
            'The key "{}" cannot be used to encrypt'.format(key.uids[0].uid),
            code=GPGCode.KEY_CANNOT_ENCRYPT)