Skip to content

Commit b12c35d

Browse files
committed
Clarify class names
1 parent ecc2897 commit b12c35d

5 files changed

Lines changed: 18 additions & 18 deletions

File tree

trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2Helper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
@RequiresApi(api = 17)
1717
public class OkHttp2Helper {
18-
private static RootTrustManager trustManager = new RootTrustManager();
18+
private static OkHttpRootTrustManager trustManager = new OkHttpRootTrustManager();
1919

2020
/**
2121
* Retrieve an {@code SSLSSocketFactory} that implements SSL pinning validation based on the
@@ -42,11 +42,11 @@ public static SSLSocketFactory getSSLSocketFactory() {
4242

4343
/**
4444
* Returns an {@link com.squareup.okhttp.Interceptor} used to parse the hostname of the
45-
* {@link Request} URL and then save the hostname in the {@link RootTrustManager} which will
45+
* {@link Request} URL and then save the hostname in the {@link OkHttpRootTrustManager} which will
4646
* later be used for Certificate Pinning.
4747
*/
4848
@NonNull
4949
public static Interceptor getPinningInterceptor() {
50-
return new PinningInterceptor2(trustManager);
50+
return new OkHttp2PinningInterceptor(trustManager);
5151
}
5252
}

trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/PinningInterceptor2.java renamed to trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp2PinningInterceptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
/**
1212
* {@link Interceptor} used to parse the hostname of the {@link Request} URL and then save the
13-
* hostname in the {@link RootTrustManager} which will later be used for Certificate Pinning.
13+
* hostname in the {@link OkHttpRootTrustManager} which will later be used for Certificate Pinning.
1414
*/
15-
public class PinningInterceptor2 implements Interceptor {
16-
private final RootTrustManager mTrustManager;
15+
public class OkHttp2PinningInterceptor implements Interceptor {
16+
private final OkHttpRootTrustManager mTrustManager;
1717

18-
public PinningInterceptor2(@NonNull RootTrustManager trustManager) {
18+
public OkHttp2PinningInterceptor(@NonNull OkHttpRootTrustManager trustManager) {
1919
mTrustManager = trustManager;
2020
}
2121

trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3Helper.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
@RequiresApi(api = 17)
1717
public class OkHttp3Helper {
18-
private static RootTrustManager trustManager = new RootTrustManager();
18+
private static OkHttpRootTrustManager trustManager = new OkHttpRootTrustManager();
1919

2020
/**
2121
* Retrieve an {@code SSLSSocketFactory} that implements SSL pinning validation based on the
@@ -42,19 +42,19 @@ public static SSLSocketFactory getSSLSocketFactory() {
4242

4343
/**
4444
* Returns an {@link okhttp3.Interceptor} used to parse the hostname of the {@link Request} URL
45-
* and then save the hostname in the {@link RootTrustManager} which will later be used for
45+
* and then save the hostname in the {@link OkHttpRootTrustManager} which will later be used for
4646
* Certificate Pinning.
4747
*/
4848
@NonNull
4949
public static Interceptor getPinningInterceptor() {
50-
return new PinningInterceptor(trustManager);
50+
return new OkHttp3PinningInterceptor(trustManager);
5151
}
5252

5353
/**
54-
* Returns an instance of the {@link RootTrustManager} used for Certificate Pinning.
54+
* Returns an instance of the {@link OkHttpRootTrustManager} used for Certificate Pinning.
5555
*/
5656
@NonNull
57-
public static RootTrustManager getTrustManager() {
57+
public static OkHttpRootTrustManager getTrustManager() {
5858
return trustManager;
5959
}
6060
}

trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/PinningInterceptor.java renamed to trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttp3PinningInterceptor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
/**
1212
* {@link Interceptor} used to parse the hostname of the {@link Request} URL and then save the
13-
* hostname in the {@link RootTrustManager} which will later be used for Certificate Pinning.
13+
* hostname in the {@link OkHttpRootTrustManager} which will later be used for Certificate Pinning.
1414
*/
15-
public class PinningInterceptor implements Interceptor {
16-
private final RootTrustManager mTrustManager;
15+
public class OkHttp3PinningInterceptor implements Interceptor {
16+
private final OkHttpRootTrustManager mTrustManager;
1717

18-
public PinningInterceptor(@NonNull RootTrustManager trustManager) {
18+
public OkHttp3PinningInterceptor(@NonNull OkHttpRootTrustManager trustManager) {
1919
mTrustManager = trustManager;
2020
}
2121

trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/RootTrustManager.java renamed to trustkit/src/main/java/com/datatheorem/android/trustkit/pinning/OkHttpRootTrustManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* {@link X509TrustManager} used for Certificate Pinning.
1818
*
1919
* <p>This trust manager delegates to the appropriate {@link PinningTrustManager} decided by the
20-
* hostname set by the {@link PinningInterceptor}.</p>
20+
* hostname set by the {@link OkHttp3PinningInterceptor}.</p>
2121
*/
2222
@RequiresApi(api = 17)
23-
class RootTrustManager implements X509TrustManager {
23+
class OkHttpRootTrustManager implements X509TrustManager {
2424
private final ThreadLocal<String> mServerHostname = new ThreadLocal<>();
2525

2626
@Override

0 commit comments

Comments
 (0)