1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.socksx.v5;
17
18 import io.netty.handler.codec.DecoderResult;
19 import io.netty.util.internal.ObjectUtil;
20 import io.netty.util.internal.StringUtil;
21
22
23
24
25
26
27
28
29 public final class DefaultSocks5PrivateAuthRequest extends AbstractSocks5Message
30 implements Socks5PrivateAuthRequest {
31
32
33
34
35 private final byte[] privateToken;
36
37
38
39
40
41
42 public DefaultSocks5PrivateAuthRequest(final byte[] privateAuthToken) {
43 this.privateToken = ObjectUtil.checkNotNull(privateAuthToken, "privateToken").clone();
44 }
45
46 @Override
47 public byte[] privateToken() {
48 return privateToken.clone();
49 }
50
51 @Override
52 public String toString() {
53 StringBuilder buf = new StringBuilder(StringUtil.simpleClassName(this));
54
55 DecoderResult decoderResult = decoderResult();
56 if (!decoderResult.isSuccess()) {
57 buf.append("(decoderResult: ");
58 buf.append(decoderResult);
59 buf.append(", privateToken: ****)");
60 } else {
61 buf.append("(privateToken: ****)");
62 }
63
64 return buf.toString();
65 }
66 }