MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / rrToString

Method rrToString

src/main/java/core/org/xbill/DNS/TSIGRecord.java:97–151  ·  view source on GitHub ↗

Converts rdata to a String

()

Source from the content-addressed store, hash-verified

95
96/** Converts rdata to a String */
97String
98rrToString() {
99 StringBuffer sb = new StringBuffer();
100 sb.append(alg);
101 sb.append(" ");
102 if (Options.check("multiline"))
103 sb.append("(\n\t");
104
105 sb.append (timeSigned.getTime() / 1000);
106 sb.append (" ");
107 sb.append (fudge);
108 sb.append (" ");
109 sb.append (signature.length);
110 if (Options.check("multiline")) {
111 sb.append ("\n");
112 sb.append (base64.formatString(signature, 64, "\t", false));
113 } else {
114 sb.append (" ");
115 sb.append (base64.toString(signature));
116 }
117 sb.append (" ");
118 sb.append (Rcode.TSIGstring(error));
119 sb.append (" ");
120 if (other == null)
121 sb.append (0);
122 else {
123 sb.append (other.length);
124 if (Options.check("multiline"))
125 sb.append("\n\n\n\t");
126 else
127 sb.append(" ");
128 if (error == Rcode.BADTIME) {
129 if (other.length != 6) {
130 sb.append("<invalid BADTIME other data>");
131 } else {
132 long time = ((long)(other[0] & 0xFF) << 40) +
133 ((long)(other[1] & 0xFF) << 32) +
134 ((other[2] & 0xFF) << 24) +
135 ((other[3] & 0xFF) << 16) +
136 ((other[4] & 0xFF) << 8) +
137 ((other[5] & 0xFF) );
138 sb.append("<server time: ");
139 sb.append(new Date(time * 1000));
140 sb.append(">");
141 }
142 } else {
143 sb.append("<");
144 sb.append(base64.toString(other));
145 sb.append(">");
146 }
147 }
148 if (Options.check("multiline"))
149 sb.append(" )");
150 return sb.toString();
151}
152
153/** Returns the shared key's algorithm */
154public Name

Callers

nothing calls this directly

Calls 5

checkMethod · 0.95
TSIGstringMethod · 0.95
formatStringMethod · 0.80
appendMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected