Skip to content

Commit f940e8c

Browse files
committed
增加abe_env::recover接口
1 parent cd17d56 commit f940e8c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

devapi/abe_extern.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ std::string abe_query::recover(const std::string &ct){
5656
CATCH_AND_WRAP
5757
}
5858

59+
std::string abe_env::recover(const std::string &ct){
60+
try{
61+
std::string pt;
62+
abe.decrypt(ct, pt);
63+
return pt;
64+
}
65+
CATCH_AND_WRAP
66+
}
5967

6068
std::string abe_env::get_current_user_key(){
6169
try{

include/mysqlx/abe_extern.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class PUBLIC_API abe_env{
5858
return abe_query(sess, &abe, input);
5959
}
6060

61+
//解密
62+
std::string recover(const std::string &ct);
63+
6164
bool check_abe_key(){
6265
return abe.check_abe_key();
6366
}

0 commit comments

Comments
 (0)