摘要:
1、简单的加解密 Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(RSAKey(RSAKey::KL_1024, RSAKey::EXP_SMALL)); std::string val("I love karen!"); std::string enc = pCipher->encryptString(val); std::string dec = pCipher->decryptString(enc); std::cout<<"加密后:... 阅读全文
摘要:
1 int main(const std::vector<std::string>& args) 2 { 3 /*TO DO*/ 4 Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(CipherKey("aes256")); 5 6 std::string in("I love karen!"); 7 std::string out = pCipher->encryptString(in, Cipher::ENC_BASE64... 阅读全文
摘要:
1 int main(const std::vector<std::string>& args) 2 { 3 Timer timer; 4 Timestamp time; 5 TimerTask::Ptr pTask = new TimerTaskAdapter<LovemuApp>(*this,&LovemuApp::onTimer); 6 timer.schedule(pTask,500,500);//每2.5s执行一次timer动作 7 _event.wait(); 8... 阅读全文