**EDITOR** is empty, *pdnsutil* falls back to using *editor*.
get-meta *ZONE* [*ATTRIBUTE*]...
Get zone metadata. If no *ATTRIBUTE* given, lists all known.
+hash-password *PASSWORD*
+ This convenience command returns a hashed and salted version of the
+ password passed in parameter, for use as a webserver password or
+ api key.
hash-zone-record *ZONE* *RNAME*
This convenience command hashes the name *RNAME* according to the
NSEC3 settings of *ZONE*. Refuses to hash for zones with no NSEC3
#include <fcntl.h>
+#include "credentials.hh"
#include "dnsseckeeper.hh"
#include "dnssecinfra.hh"
#include "statbag.hh"
cout<<"generate-zone-key {zsk|ksk} [ALGORITHM] [BITS]"<<endl;
cout<<" Generate a ZSK or KSK to stdout with specified ALGORITHM and BITS"<<endl;
cout<<"get-meta ZONE [KIND ...] Get zone metadata. If no KIND given, lists all known"<<endl;
+ cout<<"hash-password PASSWORD Take a plaintext password or api key and output a hashed and salted version"<<endl;
cout<<"hash-zone-record ZONE RNAME Calculate the NSEC3 hash for RNAME in ZONE"<<endl;
#ifdef HAVE_P11KIT1
cout<<"hsm assign ZONE ALGORITHM {ksk|zsk} MODULE SLOT PIN LABEL"<<endl<<
}
return 0;
}
+ else if(cmds.at(0) == "hash-password") {
+ if (cmds.size() < 2) {
+ cerr<<"Syntax: pdnsutil hash-password PASSWORD"<<endl;
+ return 0;
+ }
+ cout<<hashPassword(cmds.at(1))<<endl;
+ return 0;
+ }
else if (cmds.at(0) == "hash-zone-record") {
if(cmds.size() < 3) {
cerr<<"Syntax: pdnsutil hash-zone-record ZONE RNAME"<<endl;