mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-02-02 11:04:00 +01:00
add b33 support in keyinfo
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
04ed29ceec
commit
a368078243
21
keyinfo.cpp
21
keyinfo.cpp
|
@ -1,5 +1,6 @@
|
||||||
#include "Identity.h"
|
#include "Identity.h"
|
||||||
#include "I2PEndian.h"
|
#include "I2PEndian.h"
|
||||||
|
#include "LeaseSet.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
|
|
||||||
static int printHelp(const char * exe, int exitcode)
|
static int printHelp(const char * exe, int exitcode)
|
||||||
{
|
{
|
||||||
std::cout << "usage: " << exe << " [-v] [-d] privatekey.dat" << std::endl;
|
std::cout << "usage: " << exe << " [-v] [-d] [-b] privatekey.dat" << std::endl;
|
||||||
return exitcode;
|
return exitcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +32,9 @@ int main(int argc, char * argv[])
|
||||||
|
|
||||||
int opt;
|
int opt;
|
||||||
bool print_full = false;
|
bool print_full = false;
|
||||||
|
bool print_blinded = false;
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
while((opt = getopt(argc, argv, "hvd")) != -1) {
|
while((opt = getopt(argc, argv, "hvdb")) != -1) {
|
||||||
switch(opt){
|
switch(opt){
|
||||||
case 'h':
|
case 'h':
|
||||||
return printHelp(argv[0], 0);
|
return printHelp(argv[0], 0);
|
||||||
|
@ -42,6 +44,9 @@ int main(int argc, char * argv[])
|
||||||
case 'd':
|
case 'd':
|
||||||
print_full = true;
|
print_full = true;
|
||||||
break;
|
break;
|
||||||
|
case 'b':
|
||||||
|
print_blinded = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return printHelp(argv[0], -1);
|
return printHelp(argv[0], -1);
|
||||||
}
|
}
|
||||||
|
@ -95,4 +100,16 @@ int main(int argc, char * argv[])
|
||||||
std::cout << ident.ToBase32() << ".b32.i2p" << std::endl;
|
std::cout << ident.ToBase32() << ".b32.i2p" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (print_blinded) {
|
||||||
|
if (dest->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519 ||
|
||||||
|
dest->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519 ) // 11 or 7
|
||||||
|
{
|
||||||
|
i2p::data::BlindedPublicKey blindedKey (dest);
|
||||||
|
std::cout << "b33 address: " << blindedKey.ToB33 () << ".b32.i2p" << std::endl;
|
||||||
|
std::cout << "Today's store hash: " << blindedKey.GetStoreHash ().ToBase64 () << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
std::cout << "Invalid signature type " << SigTypeToName (dest->GetSigningKeyType ()) << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue