Class OkHttpEncryptionInterceptor
- java.lang.Object
-
- com.mastercard.developer.interceptors.OkHttpEncryptionInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
- Direct Known Subclasses:
OkHttpFieldLevelEncryptionInterceptor
,OkHttpJweInterceptor
public abstract class OkHttpEncryptionInterceptor extends Object implements okhttp3.Interceptor
-
-
Constructor Summary
Constructors Constructor Description OkHttpEncryptionInterceptor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract String
decryptPayload(okhttp3.Response response, okhttp3.Response.Builder newBuilder, String responsePayload)
protected abstract String
encryptPayload(okhttp3.Request request, okhttp3.Request.Builder newBuilder, String requestPayload)
static OkHttpEncryptionInterceptor
from(EncryptionConfig config)
okhttp3.Response
intercept(okhttp3.Interceptor.Chain chain)
-
-
-
Method Detail
-
from
public static OkHttpEncryptionInterceptor from(EncryptionConfig config)
-
encryptPayload
protected abstract String encryptPayload(okhttp3.Request request, okhttp3.Request.Builder newBuilder, String requestPayload) throws EncryptionException
- Throws:
EncryptionException
-
decryptPayload
protected abstract String decryptPayload(okhttp3.Response response, okhttp3.Response.Builder newBuilder, String responsePayload) throws EncryptionException
- Throws:
EncryptionException
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException
- Specified by:
intercept
in interfaceokhttp3.Interceptor
- Throws:
IOException
-
-