MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / keyHandle

Method keyHandle

examples/dbcrypt/CryptKeyHolder.cpp:294–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294ICryptKeyCallback* CryptKeyHolder::keyHandle(CheckStatusWrapper* status, const char* keyName)
295{
296 if (keyName[0] == 0)
297 return &callbackInterface;
298
299 for (NamedCallback* n = named; n; n = n->next)
300 {
301 if (strcmp(keyName, n->name) == 0)
302 return n;
303 }
304
305 char kn[40];
306 strcpy(kn, "Key");
307 strncat(kn, keyName, sizeof(kn) - 3 - 1);
308 kn[sizeof(kn) - 1] = 0;
309
310 IConfigEntry* confEntry = getEntry(status, kn);
311 if (confEntry)
312 {
313 int k = confEntry->getIntValue();
314 confEntry->release();
315 if (k > 0 && k < 256)
316 {
317 named = new NamedCallback(named, keyName, static_cast<ISC_UCHAR>(k));
318 return named;
319 }
320 }
321
322 return NULL;
323}
324
325ICryptKeyCallback* CryptKeyHolder::chainHandle(CheckStatusWrapper* status)
326{

Callers 1

setKeyMethod · 0.45

Calls 2

getIntValueMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected