com.facebook.crypto.CryptoConfig Java Examples

The following examples show how to use com.facebook.crypto.CryptoConfig. 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: 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 #3
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 #4
Source File: ConcealEncryption.java    From hawk with Apache License 2.0 4 votes vote down vote up
public ConcealEncryption(Context context) {
  this(new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256));
}