mirror of
https://github.com/SunnyQjm/MIRCertificationManager.git
synced 2026-10-05 01:15:41 +08:00
add: 完成安装卸载样例程序编写
This commit is contained in:
1 parent
ca4b49c59b
commit
1339a5d255
2 files changed
+31
-1
No files matched your search
+7
-1
@@ -10,4 +10,10 @@ add_executable(installCertificate installCertificate.cpp
|
||||
utils/FileUtils.cpp
|
||||
utils/RedisUtil.cpp
|
||||
utils/NDNCertificationUtil.cpp)
|
||||
target_link_libraries(installCertificate ndn-cxx boost_system hiredis)
|
||||
target_link_libraries(installCertificate ndn-cxx boost_system hiredis)
|
||||
|
||||
add_executable(uninstallCertificate uninstallCertificate.cpp
|
||||
utils/FileUtils.cpp
|
||||
utils/RedisUtil.cpp
|
||||
utils/NDNCertificationUtil.cpp)
|
||||
target_link_libraries(uninstallCertificate ndn-cxx boost_system hiredis)
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Created by mingj on 2020/5/30.
|
||||
//
|
||||
|
||||
#include "utils/FileUtils.h"
|
||||
#include "utils/NDNCertificationUtil.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc < 3) {
|
||||
cout << "Usage : ./installCert -f <filename> " << endl;
|
||||
}
|
||||
|
||||
// 读取文件里的证书为字符串
|
||||
string certStr = FileUtils::readFile2String(argv[2]);
|
||||
cout << "Read cert: " << endl << certStr << endl;
|
||||
|
||||
NDNCertificationUtil ndnCertificationUtil;
|
||||
ndnCertificationUtil.connect();
|
||||
auto result = ndnCertificationUtil.uninstallCert(certStr);
|
||||
cout << "install cert result: " << result << endl;
|
||||
}
|
||||
Reference in new issue
Block a user