コード例 #1
0
ファイル: getKeysTest.cpp プロジェクト: Stavrosnco/PARIS
int main(int argc, char* argv[]){
   int res;
   int toGet;

   std::vector<RSA*> allPrivateKeys;
   uint32_t allPublicKeys[100][32];

   if(argc != 3){
      puts("wrong number of args. takes db to open, num to get");
      return 0;
   }

   puts("Starting key printer...");

   toGet = atoi(argv[2]);

   //run through the DB passed in and get all they keys from it
   res = getAllKeys(argv[1], toGet, &allPrivateKeys, allPublicKeys);

   printf("Asked for %d keys, got %d\n", toGet, res);
   printf("after, vector of private keys was %d\n", (int)allPrivateKeys.size());
   printf("after, vector of public keys was %d\n", res);

   //RSA_print_fp(stdout, allPrivateKeys.at(0), 0);

   //0 is MSB for our 1024
   BIGNUM *n = allPrivateKeys.at(0)->n;
   BN_print_fp(stdout, n);
   printf("\ntop = %d and 0th is\t%02x\n", n->dmax, (uint32_t)n->d[0]);
   printf("bottom = \t\t%02x\n", allPublicKeys[0][31]);

   return 0;
}
コード例 #2
0
ファイル: IDBIndex.cpp プロジェクト: ollie314/webkit
ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count)
{
    auto onlyResult = IDBKeyRange::only(execState, key);
    if (onlyResult.hasException())
        return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'getAllKeys' on 'IDBIndex': The parameter is not a valid key.") };

    return getAllKeys(execState, onlyResult.releaseReturnValue(), count);
}
コード例 #3
0
ファイル: getKeys-justDB.cpp プロジェクト: Stavrosnco/PARIS
int main(void){
   puts("Starting key printer...");

   std::vector<uint8_t*> allKeys;

   int res = getAllKeys("keys-100k.db", &allKeys);

   printf("res of call was %d\n", res);
   printf("after, vector of keys was %d\n", (int)allKeys.size());

   return 0;
}
コード例 #4
0
 void listDisplays(std::wostream& out) {
   out << "List of all displays connected one day to your computer:" << std::endl;
   std::list<std::wstring> allKeys = getAllKeys();
   for (std::list<std::wstring>::iterator it = allKeys.begin(); it != allKeys.end(); it++)
   {
     std::wstring achKey = *it;
     winDisplayInfo dinfo;
     getDisplayInfo(achKey,&dinfo);
     if ((dinfo.w > 0) && (dinfo.h > 0))
       out << "windisplay:/" << achKey << " [" << dinfo.monitorName
           << ", " << dinfo.w << "x" << dinfo.h << " mm"
           << ", " << dinfo.resx << "x" << dinfo.resy << " pixels"
           << ", " << dinfo.ppi << " PPI"
           << ", " << dinfo.refreshRate << " Hz]" << std::endl;
   }
 }
コード例 #5
0
 DisplayDescriptorSet winDisplayDeviceManager::readAllFromRegistry()
 {
   DisplayDescriptorSet result;
   list<wstring> allKeys = getAllKeys();
   for (list<wstring>::iterator it = allKeys.begin(); it != allKeys.end(); it++)
   {
     wstring achKey = *it;
     winDisplayInfo dinfo;
     getDisplayInfo(achKey,&dinfo);
     if ((dinfo.w > 0) && (dinfo.h > 0))
     {
       DisplayDeviceDescriptor desc;
       desc.devURI = uriForDisplayId(achKey).asString();
       desc.name = dinfo.monitorName;
       result.insert(desc);
     }
   }
   return result;
 }
コード例 #6
0
IDBRequest* IDBIndex::getAllKeys(ScriptState* scriptState, const ScriptValue& range, ExceptionState& exceptionState)
{
    return getAllKeys(scriptState, range, std::numeric_limits<uint32_t>::max(), exceptionState);
}
コード例 #7
0
IDBRequest* IDBObjectStore::getAllKeys(ScriptState* scriptState, const ScriptValue& keyRange, ExceptionState& exceptionState)
{
    return getAllKeys(scriptState, keyRange, std::numeric_limits<uint32_t>::max(), exceptionState);
}