Handshake.java
3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.squareup.okhttp;
import com.squareup.okhttp.internal.Util;
import java.security.Principal;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Collections;
import java.util.List;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
public final class Handshake
{
private final String cipherSuite;
private final List<Certificate> localCertificates;
private final List<Certificate> peerCertificates;
private Handshake(String paramString, List<Certificate> paramList1, List<Certificate> paramList2)
{
this.cipherSuite = paramString;
this.peerCertificates = paramList1;
this.localCertificates = paramList2;
}
public static Handshake get(String paramString, List<Certificate> paramList1, List<Certificate> paramList2)
{
if (paramString == null) {
throw new IllegalArgumentException("cipherSuite == null");
}
return new Handshake(paramString, Util.immutableList(paramList1), Util.immutableList(paramList2));
}
public static Handshake get(SSLSession paramSSLSession)
{
String str = paramSSLSession.getCipherSuite();
if (str == null) {
throw new IllegalStateException("cipherSuite == null");
}
try
{
Object localObject = paramSSLSession.getPeerCertificates();
if (localObject != null)
{
localObject = Util.immutableList((Object[])localObject);
paramSSLSession = paramSSLSession.getLocalCertificates();
if (paramSSLSession == null) {
break label77;
}
paramSSLSession = Util.immutableList(paramSSLSession);
return new Handshake(str, (List)localObject, paramSSLSession);
}
}
catch (SSLPeerUnverifiedException localSSLPeerUnverifiedException)
{
for (;;)
{
List localList = null;
continue;
localList = Collections.emptyList();
continue;
label77:
paramSSLSession = Collections.emptyList();
}
}
}
public final String cipherSuite()
{
return this.cipherSuite;
}
public final boolean equals(Object paramObject)
{
if (!(paramObject instanceof Handshake)) {}
do
{
return false;
paramObject = (Handshake)paramObject;
} while ((!this.cipherSuite.equals(((Handshake)paramObject).cipherSuite)) || (!this.peerCertificates.equals(((Handshake)paramObject).peerCertificates)) || (!this.localCertificates.equals(((Handshake)paramObject).localCertificates)));
return true;
}
public final int hashCode()
{
return ((this.cipherSuite.hashCode() + 527) * 31 + this.peerCertificates.hashCode()) * 31 + this.localCertificates.hashCode();
}
public final List<Certificate> localCertificates()
{
return this.localCertificates;
}
public final Principal localPrincipal()
{
if (!this.localCertificates.isEmpty()) {
return ((X509Certificate)this.localCertificates.get(0)).getSubjectX500Principal();
}
return null;
}
public final List<Certificate> peerCertificates()
{
return this.peerCertificates;
}
public final Principal peerPrincipal()
{
if (!this.peerCertificates.isEmpty()) {
return ((X509Certificate)this.peerCertificates.get(0)).getSubjectX500Principal();
}
return null;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/squareup/okhttp/Handshake.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/