}
}
+/**
+ * Returns the supported DNSSEC algorithms with the name of the Crypto Backend used
+ *
+ * @return A vector with pairs of (algorithm-number (int), backend-name (string))
+ */
+vector<pair<uint8_t, string>> DNSCryptoKeyEngine::listAllAlgosWithBackend()
+{
+ vector<pair<uint8_t, string>> ret;
+ for (auto const& value : getMakers()) {
+ shared_ptr<DNSCryptoKeyEngine> dcke(value.second(value.first));
+ ret.push_back(make_pair(value.first, dcke->getName()));
+ }
+ return ret;
+}
+
void DNSCryptoKeyEngine::report(unsigned int algo, maker_t* maker, bool fallback)
{
getAllMakers()[algo].push_back(maker);
static void report(unsigned int algorithm, maker_t* maker, bool fallback=false);
static std::pair<unsigned int, unsigned int> testMakers(unsigned int algorithm, maker_t* creator, maker_t* signer, maker_t* verifier);
+ static vector<pair<uint8_t, string>> listAllAlgosWithBackend();
static bool testAll();
static bool testOne(int algo);
private:
cerr<<" [active|inactive] [ksk|zsk] Defaults to KSK and active"<<endl;
cerr<<"load-zone ZONE FILE Load ZONE from FILE, possibly creating zone or atomically"<<endl;
cerr<<" replacing contents"<<endl;
+ cerr<<"list-algorithms [with-backend] List all DNSSEC algorithms supported, optionally also listing the crypto library used"<<endl;
cerr<<"list-keys [ZONE] List DNSSEC keys for ZONE. When ZONE is unset or \"all\", display all keys for all zones"<<endl;
cerr<<"list-zone ZONE List zone contents"<<endl;
cerr<<"list-all-zones [master|slave|native]"<<endl;
return 1;
}
+ if(cmds[0] == "list-algorithms") {
+ if((cmds.size() == 2 && cmds[1] != "with-backend") || cmds.size() > 2) {
+ cerr<<"Syntax: pdnsutil list-algorithms [with-backend]"<<endl;
+ return 1;
+ }
+
+ cout<<"DNSKEY algorithms supported by this installation of PowerDNS:"<<endl;
+
+ auto algosWithBackend = DNSCryptoKeyEngine::listAllAlgosWithBackend();
+ for (auto const algoWithBackend : algosWithBackend){
+ string algoName = DNSSECKeeper::algorithm2name(algoWithBackend.first);
+ cout<<std::to_string(algoWithBackend.first)<<" - "<<algoName;
+ if (cmds.size() == 2 && cmds[1] == "with-backend")
+ cout<<" using "<<algoWithBackend.second;
+ cout<<endl;
+ }
+ return 0;
+ }
+
reportAllTypes();
if(cmds[0] == "create-bind-db") {