| | |
| | | try { |
| | | end_date = normalize_date(dt_end); |
| | | char curdate[20]; |
| | | time_t curtime = time(NULL); |
| | | time_t curtime = time(nullptr); |
| | | strftime(curdate, 20, "%Y-%m-%d", localtime(&curtime)); |
| | | begin_date.assign(curdate); |
| | | } catch (const invalid_argument &e) { |
| | |
| | | void LicenseGenerator::generateAndOutputLicenses(const po::variables_map& vm, |
| | | ostream& outputFile) { |
| | | vector<FullLicenseInfo> licenseInfo = parseLicenseInfo(vm); |
| | | unique_ptr<CryptoHelper> helper = CryptoHelper::getInstance(); |
| | | const char pkey[] = PRIVATE_KEY; |
| | | size_t len = sizeof(pkey); |
| | | const unique_ptr<CryptoHelper> helper = CryptoHelper::getInstance(); |
| | | const unsigned char pkey[] = PRIVATE_KEY; |
| | | const size_t len = sizeof(pkey); |
| | | for (auto it = licenseInfo.begin(); it != licenseInfo.end(); ++it) { |
| | | const string license = it->printForSign(); |
| | | string signature = helper->signString((const void *)pkey,len,license); |
| | | const string signature = helper->signString((const void *)pkey,len,license); |
| | | it->license_signature = signature; |
| | | it->printAsIni(outputFile); |
| | | } |