/** * Returns the maximum length of a TSIG record generated by this key. * @see TSIGRecord */ public int recordLength() { return (name.length() + 10 + alg.length() + 8 + // time signed, fudge 18 + // 2 byte MAC length, 16 byte MAC 4 + // original id, error 8); // 2 byte error length, 6 byte max error field. }
/** * Returns the maximum length of a TSIG record generated by this key. * @see TSIGRecord */ public int recordLength() { return (name.length() + 10 + alg.length() + 8 + // time signed, fudge 18 + // 2 byte MAC length, 16 byte MAC 4 + // original id, error 8); // 2 byte error length, 6 byte max error field. }
/** * Returns the maximum length of a TSIG record generated by this key. * @see TSIGRecord */ public int recordLength() { return (name.length() + 10 + alg.length() + 8 + // time signed, fudge 18 + // 2 byte MAC length, 16 byte MAC 4 + // original id, error 8); // 2 byte error length, 6 byte max error field. }
/** * Returns the maximum length of a TSIG record generated by this key. * @see TSIGRecord */ public int recordLength() { return (name.length() + 10 + alg.length() + 8 + // time signed, fudge 18 + // 2 byte MAC length, 16 byte MAC 4 + // original id, error 8); // 2 byte error length, 6 byte max error field. }
/** * If this name is a subdomain of origin, return a new name relative to * origin with the same value. Otherwise, return the existing name. * @param origin The origin to remove. * @return The possibly relativized name. */ public Name relativize(Name origin) { if (origin == null || !subdomain(origin)) return this; Name newname = new Name(); copy(this, newname); int length = length() - origin.length(); int labels = newname.labels() - origin.labels(); newname.setlabels(labels); newname.name = new byte[length]; System.arraycopy(name, offset(0), newname.name, 0, length); return newname; }
/** * If this name is a subdomain of origin, return a new name relative to * origin with the same value. Otherwise, return the existing name. * @param origin The origin to remove. * @return The possibly relativized name. */ public Name relativize(Name origin) { if (origin == null || !subdomain(origin)) return this; Name newname = new Name(); copy(this, newname); int length = length() - origin.length(); int labels = newname.labels() - origin.labels(); newname.setlabels(labels); newname.name = new byte[length]; System.arraycopy(name, offset(0), newname.name, 0, length); return newname; }
/** * If this name is a subdomain of origin, return a new name relative to * origin with the same value. Otherwise, return the existing name. * @param origin The origin to remove. * @return The possibly relativized name. */ public Name relativize(Name origin) { if (origin == null || !subdomain(origin)) return this; Name newname = new Name(); copy(this, newname); int length = length() - origin.length(); int labels = newname.labels() - origin.labels(); newname.setlabels(labels); newname.name = new byte[length]; System.arraycopy(name, offset(0), newname.name, 0, length); return newname; }
/** * If this name is a subdomain of origin, return a new name relative to * origin with the same value. Otherwise, return the existing name. * @param origin The origin to remove. * @return The possibly relativized name. */ public Name relativize(Name origin) { if (origin == null || !subdomain(origin)) return this; Name newname = new Name(); copy(this, newname); int length = length() - origin.length(); int labels = newname.labels() - origin.labels(); newname.setlabels(labels); newname.name = new byte[length]; System.arraycopy(name, offset(0), newname.name, 0, length); return newname; }
super_name = new byte[name.length()]; int current = 0; for (int index = 0; index < labelCount; index++)