|
|
@ -1,12 +1,23 @@ |
|
|
|
#include "Identity.h" |
|
|
|
#include "Identity.h" |
|
|
|
|
|
|
|
#include "I2PEndian.h" |
|
|
|
#include <iostream> |
|
|
|
#include <iostream> |
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
#include <string> |
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
#include <vector> |
|
|
|
#include <unistd.h> |
|
|
|
#include <unistd.h> |
|
|
|
|
|
|
|
#include <stdio.h> |
|
|
|
|
|
|
|
#include <time.h> |
|
|
|
#include "common/key.hpp" |
|
|
|
#include "common/key.hpp" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string ConvertTime (time_t t) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
struct tm *tm = localtime(&t); |
|
|
|
|
|
|
|
char date[128]; |
|
|
|
|
|
|
|
snprintf(date, sizeof(date), "%02d/%02d/%d %02d:%02d:%02d", tm->tm_mday, tm->tm_mon + 1, tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec); |
|
|
|
|
|
|
|
return date; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char * argv[]) |
|
|
|
int main(int argc, char * argv[]) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(argc == 1) { |
|
|
|
if(argc == 1) { |
|
|
@ -62,7 +73,13 @@ int main(int argc, char * argv[]) |
|
|
|
std::cout << "B32 Address: " << ident.ToBase32() << ".b32.i2p" << std::endl; |
|
|
|
std::cout << "B32 Address: " << ident.ToBase32() << ".b32.i2p" << std::endl; |
|
|
|
std::cout << "Signature Type: " << SigTypeToName(dest->GetSigningKeyType()) << std::endl; |
|
|
|
std::cout << "Signature Type: " << SigTypeToName(dest->GetSigningKeyType()) << std::endl; |
|
|
|
std::cout << "Encryption Type: " << (int) dest->GetCryptoKeyType() << std::endl; |
|
|
|
std::cout << "Encryption Type: " << (int) dest->GetCryptoKeyType() << std::endl; |
|
|
|
if (keys.IsOfflineSignature ()) std::cout << "Offline signature" << std::endl; |
|
|
|
if (keys.IsOfflineSignature ()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
std::cout << "Offline signature" << std::endl; |
|
|
|
|
|
|
|
const auto& offlineSignature = keys.GetOfflineSignature (); |
|
|
|
|
|
|
|
std::cout << "Expires: " << ConvertTime (bufbe32toh(offlineSignature.data ())) << std::endl; |
|
|
|
|
|
|
|
std::cout << "Transient Signature Type: " << SigTypeToName(bufbe16toh(offlineSignature.data () + 4)) << std::endl; |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(print_full) { |
|
|
|
if(print_full) { |
|
|
|
std::cout << dest->ToBase64() << std::endl; |
|
|
|
std::cout << dest->ToBase64() << std::endl; |
|
|
|