use of org.whispersystems.signalservice.api.push.TrustStore in project Signal-Android by WhisperSystems.
the class ContactDiscoveryV2 method getIasKeyStore.
private static KeyStore getIasKeyStore(@NonNull Context context) {
try {
TrustStore contactTrustStore = new IasTrustStore(context);
KeyStore keyStore = KeyStore.getInstance("BKS");
keyStore.load(contactTrustStore.getKeyStoreInputStream(), contactTrustStore.getKeyStorePassword().toCharArray());
return keyStore;
} catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) {
throw new AssertionError(e);
}
}
use of org.whispersystems.signalservice.api.push.TrustStore in project Signal-Android by WhisperSystems.
the class IasKeyStore method getIasKeyStore.
public static KeyStore getIasKeyStore(@NonNull Context context) {
try {
TrustStore contactTrustStore = new IasTrustStore(context);
KeyStore keyStore = KeyStore.getInstance("BKS");
keyStore.load(contactTrustStore.getKeyStoreInputStream(), contactTrustStore.getKeyStorePassword().toCharArray());
return keyStore;
} catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) {
throw new AssertionError(e);
}
}
use of org.whispersystems.signalservice.api.push.TrustStore in project Signal-Android by signalapp.
the class BadgeLoader method createFactory.
public static Factory createFactory() {
try {
OkHttpClient baseClient = ApplicationDependencies.getOkHttpClient();
SSLContext sslContext = SSLContext.getInstance("TLS");
TrustStore trustStore = new SignalServiceTrustStore(ApplicationDependencies.getApplication());
TrustManager[] trustManagers = BlacklistingTrustManager.createFor(trustStore);
sslContext.init(null, trustManagers, null);
OkHttpClient client = baseClient.newBuilder().sslSocketFactory(new Tls12SocketFactory(sslContext.getSocketFactory()), (X509TrustManager) trustManagers[0]).connectionSpecs(Util.immutableList(ConnectionSpec.RESTRICTED_TLS)).build();
return new Factory(client);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
throw new AssertionError(e);
}
}
use of org.whispersystems.signalservice.api.push.TrustStore in project Signal-Android by WhisperSystems.
the class BadgeLoader method createFactory.
public static Factory createFactory() {
try {
OkHttpClient baseClient = ApplicationDependencies.getOkHttpClient();
SSLContext sslContext = SSLContext.getInstance("TLS");
TrustStore trustStore = new SignalServiceTrustStore(ApplicationDependencies.getApplication());
TrustManager[] trustManagers = BlacklistingTrustManager.createFor(trustStore);
sslContext.init(null, trustManagers, null);
OkHttpClient client = baseClient.newBuilder().sslSocketFactory(new Tls12SocketFactory(sslContext.getSocketFactory()), (X509TrustManager) trustManagers[0]).connectionSpecs(Util.immutableList(ConnectionSpec.RESTRICTED_TLS)).build();
return new Factory(client);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
throw new AssertionError(e);
}
}
use of org.whispersystems.signalservice.api.push.TrustStore in project Signal-Android by signalapp.
the class IasKeyStore method getIasKeyStore.
public static KeyStore getIasKeyStore(@NonNull Context context) {
try {
TrustStore contactTrustStore = new IasTrustStore(context);
KeyStore keyStore = KeyStore.getInstance("BKS");
keyStore.load(contactTrustStore.getKeyStoreInputStream(), contactTrustStore.getKeyStorePassword().toCharArray());
return keyStore;
} catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) {
throw new AssertionError(e);
}
}
Aggregations