git-svn-id: svn://db.shs.com.ru/pip@609 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
58
main.cpp
58
main.cpp
@@ -60,11 +60,40 @@ int main(int argc, char *argv[]) {
|
||||
piCout << "decrypted" << dba.toHex() << PIString(dba);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
piCout << "=======================================";
|
||||
|
||||
PIAuth server(PIAuth::generateSign(pkey1));
|
||||
|
||||
msg = "This is Server with PIAuth";
|
||||
server.setInfoData(msg.toUTF8());
|
||||
|
||||
PIAuth client(PIAuth::generateSign(pkey2));
|
||||
|
||||
client.setAuthorizedPublicKeys(PIVector<PIByteArray>() << server.getSignPublicKey());
|
||||
// server.setAuthorizedPublicKeys(PIVector<PIByteArray>() << client.getSignPublicKey());
|
||||
Obj o;
|
||||
@@ -77,6 +106,9 @@ int main(int argc, char *argv[]) {
|
||||
ba = server.startServer();
|
||||
int st = PIAuth::AuthProbe;
|
||||
piCout << "server" << st << ba.toHex() << ba.size();
|
||||
|
||||
|
||||
|
||||
// ba[40] = 2;
|
||||
// {
|
||||
// int s;
|
||||
@@ -94,6 +126,9 @@ int main(int argc, char *argv[]) {
|
||||
// rsign = crypt.signMessage(ba, sign2);
|
||||
// ba << rsign;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
st = client.receive(ba);
|
||||
piCout << "client" << st << ba.toHex() << ba.size();
|
||||
st = server.receive(ba);
|
||||
@@ -113,3 +148,26 @@ int main(int argc, char *argv[]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user