Search in sources :

Example 1 with CryptoManagerImpl

use of com.github.vase4kin.teamcityapp.crypto.CryptoManagerImpl in project TeamCityApp by vase4kin.

the class AppModule method providesCryptoManager.

@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
@Provides
@Singleton
protected CryptoManager providesCryptoManager() {
    KeyChain keyChain = new SharedPrefsBackedKeyChain(mApplication.getApplicationContext(), CryptoConfig.KEY_256);
    Crypto crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
    return new CryptoManagerImpl(crypto);
}
Also used : Crypto(com.facebook.crypto.Crypto) SharedPrefsBackedKeyChain(com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain) CryptoManagerImpl(com.github.vase4kin.teamcityapp.crypto.CryptoManagerImpl) KeyChain(com.facebook.crypto.keychain.KeyChain) SharedPrefsBackedKeyChain(com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain) VisibleForTesting(android.support.annotation.VisibleForTesting) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

VisibleForTesting (android.support.annotation.VisibleForTesting)1 SharedPrefsBackedKeyChain (com.facebook.android.crypto.keychain.SharedPrefsBackedKeyChain)1 Crypto (com.facebook.crypto.Crypto)1 KeyChain (com.facebook.crypto.keychain.KeyChain)1 CryptoManagerImpl (com.github.vase4kin.teamcityapp.crypto.CryptoManagerImpl)1 Provides (dagger.Provides)1 Singleton (javax.inject.Singleton)1