2019-04-10 14:15:49 -04:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include "Identity.h"
|
|
|
|
#include "LeaseSet.h"
|
|
|
|
#include "common/key.hpp"
|
|
|
|
|
|
|
|
int main(int argc, char * argv[])
|
2020-11-17 15:06:13 +03:00
|
|
|
{
|
|
|
|
// base64 input, b33 and store key output, 11->11 only
|
|
|
|
std::cout << "Waiting for base64 from stdin..." << std::endl;
|
2019-04-10 14:15:49 -04:00
|
|
|
std::string base64;
|
|
|
|
std::getline (std::cin, base64);
|
|
|
|
auto ident = std::make_shared<i2p::data::IdentityEx>();
|
|
|
|
if (ident->FromBase64 (base64))
|
|
|
|
{
|
2024-07-23 16:12:24 -04:00
|
|
|
if (ident->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519 ||
|
|
|
|
ident->GetSigningKeyType () == i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519)
|
2019-04-10 14:15:49 -04:00
|
|
|
{
|
2019-08-02 22:02:29 +02:00
|
|
|
i2p::data::BlindedPublicKey blindedKey (ident);
|
2019-04-10 14:15:49 -04:00
|
|
|
std::cout << "b33 address: " << blindedKey.ToB33 () << ".b32.i2p" << std::endl;
|
2020-11-17 15:06:13 +03:00
|
|
|
std::cout << "Today's store hash: " << blindedKey.GetStoreHash ().ToBase64 () << std::endl;
|
2019-04-10 14:15:49 -04:00
|
|
|
}
|
|
|
|
else
|
2020-11-17 15:06:13 +03:00
|
|
|
std::cout << "Invalid signature type " << SigTypeToName (ident->GetSigningKeyType ()) << std::endl;
|
2019-04-10 14:15:49 -04:00
|
|
|
}
|
|
|
|
else
|
2020-11-17 15:06:13 +03:00
|
|
|
std::cout << "Invalid base64 address" << std::endl;
|
2019-04-10 14:15:49 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|