Electroneum
Namespaces | Functions
tools::dns_utils Namespace Reference

Namespaces

 anonymous_namespace{dns_utils.cpp}
 

Functions

std::string address_from_txt_record (const std::string &s)
 
std::vector< std::string > addresses_from_url (const std::string &url, bool &dnssec_valid)
 gets a electroneum address from the TXT record of a DNS entry More...
 
std::string get_account_address_as_str_from_url (const std::string &url, bool &dnssec_valid, std::function< std::string(const std::string &, const std::vector< std::string > &, bool)> dns_confirm)
 
bool load_txt_records_from_dns (std::vector< std::string > &good_records, const std::vector< std::string > &dns_urls, std::string type)
 
std::vector< std::string > parse_dns_public (const char *s)
 

Function Documentation

◆ address_from_txt_record()

std::string tools::dns_utils::address_from_txt_record ( const std::string &  s)

◆ addresses_from_url()

std::vector< std::string > tools::dns_utils::addresses_from_url ( const std::string &  url,
bool dnssec_valid 
)

gets a electroneum address from the TXT record of a DNS entry

gets the electroneum address from the TXT record of the DNS entry associated with <url>. If this lookup fails, or the TXT record does not contain an ETN address in the correct format, returns an empty string. <dnssec_valid> will be set true or false according to whether or not the DNS query passes DNSSEC validation.

Parameters
urlthe url to look up
dnssec_validreturn-by-reference for DNSSEC status of query
Returns
a electroneum address (as a string) or an empty string

◆ get_account_address_as_str_from_url()

std::string tools::dns_utils::get_account_address_as_str_from_url ( const std::string &  url,
bool dnssec_valid,
std::function< std::string(const std::string &, const std::vector< std::string > &, bool)>  dns_confirm 
)

◆ load_txt_records_from_dns()

bool tools::dns_utils::load_txt_records_from_dns ( std::vector< std::string > &  good_records,
const std::vector< std::string > &  dns_urls,
std::string  type 
)

◆ parse_dns_public()

std::vector< std::string > tools::dns_utils::parse_dns_public ( const char *  s)