com.facebook.crypto.keychain.KeyChain Java Examples

The following examples show how to use com.facebook.crypto.keychain.KeyChain. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SecurePreferences.java    From secure-preferences with Apache License 2.0 5 votes vote down vote up
public SharedPreferences build() {
    if(!isInit) {
        Log.w(TAG, "You need call 'SecurePreferences.init()' in onCreate() from your application class.");
    }
    KeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
    Entity entity = Entity.create(
            TextUtils.isEmpty(password) ? getClass().getPackage().getName() : password
    );
    return new SecurePreferences(
            context,
            keyChain,
            entity,
            sharedPrefFilename
    );
}
 
Example #2
Source File: SecurePreferences.java    From secure-preferences with Apache License 2.0 5 votes vote down vote up
private SecurePreferences(Context context,
                          final KeyChain keyChain,
                          final Entity entity,
                          final String sharedPrefFilename) {
    this.entity = entity;
    this.sharedPreferences = getSharedPreferenceFile(context, sharedPrefFilename);
    this.crypto = AndroidConceal.get().createCrypto256Bits(keyChain);
}
 
Example #3
Source File: CipherStorageFacebookConceal.java    From react-native-secure-storage with MIT License 4 votes vote down vote up
public CipherStorageFacebookConceal(ReactApplicationContext reactContext) {
    KeyChain keyChain = new SharedPrefsBackedKeyChain(reactContext, CryptoConfig.KEY_256);
    this.crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
 
Example #4
Source File: CipherStorageFacebookConceal.java    From react-native-keychain with MIT License 4 votes vote down vote up
public CipherStorageFacebookConceal(@NonNull final ReactApplicationContext reactContext) {
  KeyChain keyChain = new SharedPrefsBackedKeyChain(reactContext, CryptoConfig.KEY_256);

  this.crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
 
Example #5
Source File: ConcealEncryption.java    From hawk with Apache License 2.0 4 votes vote down vote up
protected ConcealEncryption(KeyChain keyChain) {
  this(AndroidConceal.get().createDefaultCrypto(keyChain));
}