本文整理汇总了C++中KeyChain::verifyData方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyChain::verifyData方法的具体用法?C++ KeyChain::verifyData怎么用?C++ KeyChain::verifyData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyChain
的用法示例。
在下文中一共展示了KeyChain::verifyData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyName
/**
* Loop to decode a data packet nIterations times using C++.
* @param nIterations The number of iterations.
* @param useCrypto If true, verify the signature. If false, don't verify.
* @param encoding The wire encoding to decode.
* @return The number of seconds for all iterations.
*/
static double
benchmarkDecodeDataSecondsCpp(int nIterations, bool useCrypto, const Blob& encoding)
{
// Initialize the KeyChain storage in case useCrypto is true.
ptr_lib::shared_ptr<MemoryIdentityStorage> identityStorage(new MemoryIdentityStorage());
ptr_lib::shared_ptr<MemoryPrivateKeyStorage> privateKeyStorage(new MemoryPrivateKeyStorage());
KeyChain keyChain
(ptr_lib::make_shared<IdentityManager>(identityStorage, privateKeyStorage),
ptr_lib::make_shared<SelfVerifyPolicyManager>(identityStorage.get()));
Name keyName("/testname/DSK-123");
identityStorage->addKey(keyName, KEY_TYPE_RSA, Blob(DEFAULT_RSA_PUBLIC_KEY_DER, sizeof(DEFAULT_RSA_PUBLIC_KEY_DER)));
double start = getNowSeconds();
for (int i = 0; i < nIterations; ++i) {
ptr_lib::shared_ptr<Data> data(new Data());
data->wireDecode(encoding);
if (useCrypto)
keyChain.verifyData(data, onVerified, onVerifyFailed);
}
double finish = getNowSeconds();
return finish - start;
}