@@ -21,23 +21,32 @@ public class UidCoreClient implements IUidCoreClient, DownloadCloudStorage {
21
21
private String userToken ;
22
22
private final String appVersionHeader ;
23
23
private boolean allowContentFromLocalFileSystem = false ;
24
+ private boolean encryptionEnabled ;
24
25
private final AttestationResponseHandler attestationResponseHandler ;
25
26
26
27
27
28
public static UidCoreClient createNoAttest (String userToken , AttestationResponseHandler attestationResponseHandler ) {
28
- return new UidCoreClient (userToken , CloudUtils .defaultProxy , attestationResponseHandler , null );
29
+ return new UidCoreClient (userToken , CloudUtils .defaultProxy , attestationResponseHandler , null , false );
29
30
}
30
31
31
32
public UidCoreClient (String userToken ,
32
33
Proxy proxy ,
33
34
AttestationResponseHandler attestationResponseHandler ) {
34
- this (userToken , proxy , attestationResponseHandler , null );
35
+ this (userToken , proxy , attestationResponseHandler , null , false );
36
+ }
37
+
38
+ public UidCoreClient (String userToken ,
39
+ Proxy proxy ,
40
+ AttestationResponseHandler attestationResponseHandler , boolean encryptionEnabled ) {
41
+ this (userToken , proxy , attestationResponseHandler , null , encryptionEnabled );
35
42
}
36
43
37
44
public UidCoreClient (String userToken ,
38
45
Proxy proxy ,
39
46
AttestationResponseHandler attestationResponseHandler ,
40
- URLConnectionHttpClient httpClient ) {
47
+ URLConnectionHttpClient httpClient ,
48
+ boolean encryptionEnabled ) {
49
+ this .encryptionEnabled = encryptionEnabled ;
41
50
this .proxy = proxy ;
42
51
this .userToken = userToken ;
43
52
this .contentStorage = new PreSignedURLStorage (proxy );
@@ -106,6 +115,8 @@ private HttpResponse<String> sendHttpRequest(String path, String attestationToke
106
115
107
116
HashMap <String , String > headers = new HashMap <>();
108
117
headers .put (Const .Http .AppVersionHeader , this .appVersionHeader );
118
+ if (this .encryptionEnabled )
119
+ headers .put ("Encrypted" , String .valueOf (this .encryptionEnabled ));
109
120
if (this .userToken != null && !this .userToken .isBlank ()) {
110
121
headers .put ("Authorization" , "Bearer " + this .userToken );
111
122
}
0 commit comments