return 0;
}
+ static int checkZoneKey(DNSSECKeeper &dsk, DNSName &zone, int64_t keyId)
+ {
+ if (keyId == -1) {
+ cerr<<std::to_string(keyId)<<": Key was added, but backend does not support returning of key id"<<endl;
+ return 0;
+ }
+ if (keyId < -1) {
+ cerr<<std::to_string(keyId)<<": Key was added, but there was a failure while returning the key id"<<endl;
+ return 1;
+ }
+ try {
+ dsk.getKeyById(zone, keyId);
+ cout<<std::to_string(keyId)<<endl;
+ } catch (std::exception& exc) {
+ cerr<<std::to_string(keyId)<<": Key was added, but there was a failure while reading it back: " <<exc.what()<<endl;
+ return 1;
+ }
+ return 0;
+ }
+
static int addZoneKey(vector<string>& cmds)
{
- if(cmds.size() < 3 ) {
+ if(cmds.size() < 2 ) {
cerr << "Syntax: pdnsutil add-zone-key ZONE [zsk|ksk] [BITS] [active|inactive] [rsasha1|rsasha1-nsec3-sha1|rsasha256|rsasha512|ecdsa256|ecdsa384";
#if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO_ED25519)
cerr << "|ed25519";