当前位置: 首页>>代码示例>>C++>>正文


C++ SecureString::getUnsecureString方法代码示例

本文整理汇总了C++中SecureString::getUnsecureString方法的典型用法代码示例。如果您正苦于以下问题:C++ SecureString::getUnsecureString方法的具体用法?C++ SecureString::getUnsecureString怎么用?C++ SecureString::getUnsecureString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecureString的用法示例。


在下文中一共展示了SecureString::getUnsecureString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: myLabelcompare

bool myLabelcompare(SecureString a, SecureString b)
{
    const char* aStr = a.getUnsecureString();
    const char* bStr = b.getUnsecureString();
    bool res = _strcmpi(aStr, bStr) < 0;
    a.UnsecuredStringFinished();
    b.UnsecuredStringFinished();
    return res;
}
开发者ID:alex-caelus,项目名称:kryptan_core,代码行数:9,代码来源:PwdList.cpp

示例2: myPwdCompare

bool myPwdCompare(Pwd* a, Pwd* b)
{
    SecureString aSstr = a->GetDescription();
    const char* aStr = aSstr.getUnsecureString();
    SecureString bSstr = b->GetDescription();
    const char* bStr = bSstr.getUnsecureString();
    bool res = _strcmpi(aStr, bStr) < 0;
    aSstr.UnsecuredStringFinished();
    bSstr.UnsecuredStringFinished();
    return res;
}
开发者ID:alex-caelus,项目名称:kryptan_core,代码行数:11,代码来源:PwdList.cpp

示例3: Filter

PwdList::PwdVector PwdList::Filter(const SecureString& pattern, const PwdLabelVector& labels)
{
    std::lock_guard<std::recursive_mutex> lock(mutex_lock);
    PwdVector filtered;
    if (pattern.length() > 0)
    {
        SecureString patternCpy = pattern;
        char* strPtrn = (char*)patternCpy.getUnsecureString();

        for (auto it = pwds.begin(); it != pwds.end(); it++)
        {
            SecureString description = (*it)->GetDescription();
            if (strcasestr((char*)description.getUnsecureString(), strPtrn) != NULL)
            {
                filtered.push_back((*it));
            }
            description.UnsecuredStringFinished();
        }

        patternCpy.UnsecuredStringFinished();
    }
    else {
        filtered = PwdVector(pwds.begin(), pwds.end());
    }

    if (labels.size() > 0)
    {
        for (auto iLabel = labels.begin(); iLabel != labels.end(); iLabel++)
        {
            PwdVector passed;
            for (auto iPwd = filtered.begin(); iPwd != filtered.end(); iPwd++)
            {
                if ((*iPwd)->HasLabel(*iLabel))
                {
                    passed.push_back(*iPwd);
                }
            }
            filtered = passed;
        }
    }

    pwds.sort(myPwdCompare);
    return filtered;
}
开发者ID:alex-caelus,项目名称:kryptan_core,代码行数:44,代码来源:PwdList.cpp

示例4: FilterLabels

PwdLabelVector PwdList::FilterLabels(SecureString pattern)
{
    std::lock_guard<std::recursive_mutex> lock(mutex_lock);
    PwdLabelVector vector;
    const char* strPtrn = pattern.getUnsecureString();
    for (auto it = existingLabels.begin(); it != existingLabels.end(); it++)
    {
        if (strstr(strPtrn, (*it).getUnsecureString()) != NULL)
        {
            vector.push_back((*it));
        }
        (*it).UnsecuredStringFinished();
    }
    pattern.UnsecuredStringFinished();

    std::sort(vector.begin(), vector.end(), myLabelcompare);
    return vector;
}
开发者ID:alex-caelus,项目名称:kryptan_core,代码行数:18,代码来源:PwdList.cpp


注:本文中的SecureString::getUnsecureString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。