本文整理汇总了C++中KeyList::csk方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyList::csk方法的具体用法?C++ KeyList::csk怎么用?C++ KeyList::csk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyList
的用法示例。
在下文中一共展示了KeyList::csk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* Finds the policy parameters of the Nth key with role.
*
* Abstraction to generalize different kind of keys.
* Note: a better solution would be inheritance.
*
* \param[in] policyKeys, Keys structure from Policy
* \param[in] index, Nth key in policyKeys, see numberOfKeyConfigs()
* for count
* \param[in] role, sort of key you are looking for.
* \param[out] bits
* \param[out] algorithm
* \param[out] lifetime
* \param[out] repository
* \param[out] manual
* */
void
keyProperties(const KeyList &policyKeys, const int index, const KeyRole role,
int *bits, int *algorithm, int *lifetime, string &repository,
bool *manual, int *rollover_type)
{
const char *scmd = "keyProperties";
/** Programming error, report a bug! */
if (index >= numberOfKeyConfigs(policyKeys, role))
ods_fatal_exit("[%s] %s Index out of bounds", module_str, scmd);
switch (role) {
case KSK:
*bits = policyKeys.ksk(index).bits();
*algorithm = policyKeys.ksk(index).algorithm();
*lifetime = policyKeys.ksk(index).lifetime();
*manual = policyKeys.ksk(index).manual_rollover();
repository.assign(policyKeys.ksk(index).repository());
*rollover_type = policyKeys.ksk(index).rollover_type();
break;
case ZSK:
*bits = policyKeys.zsk(index).bits();
*algorithm = policyKeys.zsk(index).algorithm();
*lifetime = policyKeys.zsk(index).lifetime();
*manual = policyKeys.zsk(index).manual_rollover();
repository.assign(policyKeys.zsk(index).repository());
*rollover_type = policyKeys.zsk(index).rollover_type();
break;
case CSK:
*bits = policyKeys.csk(index).bits();
*algorithm = policyKeys.csk(index).algorithm();
*lifetime = policyKeys.csk(index).lifetime();
*manual = policyKeys.csk(index).manual_rollover();
repository.assign(policyKeys.csk(index).repository());
*rollover_type = policyKeys.csk(index).rollover_type();
break;
default:
/** Programming error, report a bug! */
ods_fatal_exit("[%s] %s Unknow Role: (%d)",
module_str, scmd, role);
}
}