Package org.xbill.DNS

Examples of org.xbill.DNS.TSIG


  // }

  @SuppressWarnings("unused")
  private void addTSIG(String algstr, String namestr, String key) throws IOException {
    Name name = Name.fromString(namestr, Name.root);
    TSIGs.put(name, new TSIG(algstr, namestr, key));
  }
View Full Code Here


    }

    Record queryRecord = query.getQuestion();

    TSIGRecord queryTSIG = query.getTSIG();
    TSIG tsig = null;
    if (queryTSIG != null) {
      tsig = TSIGs.get(queryTSIG.getName());
      if (tsig == null || tsig.verify(query, in, length, null) != Rcode.NOERROR) {
        return formerrMessage(in);
      }
    }

    OPTRecord queryOPT = query.getOPT();
View Full Code Here

  // }

  @SuppressWarnings("unused")
  private void addTSIG(String algstr, String namestr, String key) throws IOException {
    Name name = Name.fromString(namestr, Name.root);
    TSIGs.put(name, new TSIG(algstr, namestr, key));
  }
View Full Code Here

    }

    Record queryRecord = query.getQuestion();

    TSIGRecord queryTSIG = query.getTSIG();
    TSIG tsig = null;
    if (queryTSIG != null) {
      tsig = TSIGs.get(queryTSIG.getName());
      if (tsig == null || tsig.verify(query, in, length, null) != Rcode.NOERROR) {
        return formerrMessage(in);
      }
    }

    OPTRecord queryOPT = query.getOPT();
View Full Code Here

            return errorMessage(query, Rcode.NOTIMP);

        Record queryRecord = query.getQuestion();

        TSIGRecord queryTSIG = query.getTSIG();
        TSIG tsig = null;
        if (queryTSIG != null) {
            tsig = (TSIG) TSIGs.get(queryTSIG.getName());
            if (tsig == null ||
                    tsig.verify(query, in, length, null) != Rcode.NOERROR)
                return formerrMessage(in);
        }

        OPTRecord queryOPT = query.getOPT();
        if (queryOPT != null && queryOPT.getVersion() > 0)
View Full Code Here

  /**
   * @param tsigKeyName A key name/user name for dns dynamic update
   * @param tsigKey A string representation of the shared key
   */
  public void setTsigKey(String tsigKeyName, String tsigKey) {
    resolver.setTSIGKey(new TSIG(tsigKeyName, tsigKey));
  }
View Full Code Here

      if(name.startsWith("_" + DnsSdTestHelper.REG_SCHEME + "._" + DnsSdTestHelper.PROTO)) {
        Update update = new Update(Name.fromString(DnsSdTestHelper.REG_DOMAIN + "."));
        update.delete(record);
        SimpleResolver resolver = new SimpleResolver(DnsSdTestHelper.DNS_SERVER);
        resolver.setTCP(true);
        resolver.setTSIGKey(new TSIG(DnsSdTestHelper.TSIG_KEY_NAME, DnsSdTestHelper.TSIG_KEY));
        Message response = resolver.send(update);
        int rcode = response.getRcode();
        assertTrue("", rcode == 0);
      }
    }
View Full Code Here

      update = new Update(zone);
      update.add(record);
    }
    final SimpleResolver resolver = new SimpleResolver(DnsSdTestHelper.DNS_SERVER);
    resolver.setTCP(true);
    resolver.setTSIGKey(new TSIG(DnsSdTestHelper.TSIG_KEY_NAME, DnsSdTestHelper.TSIG_KEY));
    final Message response = resolver.send(update);
    final int rcode = response.getRcode();
    assertTrue("", rcode == 0);
  }
View Full Code Here

    final Record record = Record.fromString(type, Type.SRV, DClass.IN, DnsSdTestHelper.TTL, s, zone);
    final Update update = new Update(zone);
    update.add(record);
    final SimpleResolver resolver = new SimpleResolver(DnsSdTestHelper.DNS_SERVER);
    resolver.setTCP(true);
    resolver.setTSIGKey(new TSIG(DnsSdTestHelper.TSIG_KEY_NAME, DnsSdTestHelper.TSIG_KEY));
    final Message response = resolver.send(update);
    final int rcode = response.getRcode();
    assertTrue("", rcode == 0);
  }
View Full Code Here

TOP

Related Classes of org.xbill.DNS.TSIG

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.