/** * Creates a copy of this Message. This is done by the Resolver before adding * TSIG and OPT records, for example. * @see Resolver * @see TSIGRecord * @see OPTRecord */ public Object clone() { Message m = new Message(); for (int i = 0; i < sections.length; i++) { if (sections[i] != null) m.sections[i] = new LinkedList(sections[i]); } m.header = (Header) header.clone(); m.size = size; return m; }
/** * Creates a copy of this Message. This is done by the Resolver before adding * TSIG and OPT records, for example. * @see Resolver * @see TSIGRecord * @see OPTRecord */ public Object clone() { Message m = new Message(); for (int i = 0; i < sections.length; i++) { if (sections[i] != null) m.sections[i] = new LinkedList(sections[i]); } m.header = (Header) header.clone(); m.size = size; return m; }
/** * Creates a copy of this Message. This is done by the Resolver before adding * TSIG and OPT records, for example. * @see Resolver * @see TSIGRecord * @see OPTRecord */ public Object clone() { Message m = new Message(); for (int i = 0; i < sections.length; i++) { if (sections[i] != null) m.sections[i] = new LinkedList(sections[i]); } m.header = (Header) header.clone(); m.size = size; return m; }
/** * Creates a copy of this Message. This is done by the Resolver before adding * TSIG and OPT records, for example. * @see Resolver * @see TSIGRecord * @see OPTRecord */ public Object clone() { Message m = new Message(); for (int i = 0; i < sections.length; i++) { if (sections[i] != null) m.sections[i] = new LinkedList(sections[i]); } m.header = (Header) header.clone(); m.size = size; return m; }
Header header = (Header) message.getHeader().clone();
static void verifyMessage(Message message, byte [] bytes, SIGRecord sig, SIGRecord previous, KEYRecord key) throws DNSSECException { if (!matches(sig, key)) throw new KeyMismatchException(key, sig); Date now = new Date(); if (now.compareTo(sig.getExpire()) > 0) throw new SignatureExpiredException(sig.getExpire(), now); if (now.compareTo(sig.getTimeSigned()) < 0) throw new SignatureNotYetValidException(sig.getTimeSigned(), now); DNSOutput out = new DNSOutput(); digestSIG(out, sig); if (previous != null) out.writeByteArray(previous.getSignature()); Header header = (Header) message.getHeader().clone(); header.decCount(Section.ADDITIONAL); out.writeByteArray(header.toWire()); out.writeByteArray(bytes, Header.LENGTH, message.sig0start - Header.LENGTH); verify(key.getPublicKey(), sig.getAlgorithm(), out.toByteArray(), sig.getSignature()); }
out.writeByteArray(previous.getSignature()); Header header = (Header) message.getHeader().clone(); header.decCount(Section.ADDITIONAL); out.writeByteArray(header.toWire());
out.writeByteArray(previous.getSignature()); Header header = (Header) message.getHeader().clone(); header.decCount(Section.ADDITIONAL); out.writeByteArray(header.toWire());