Java 类com.facebook.crypto.CryptoConfig 实例源码
项目:ConcealSharedPreference-Android
文件:ConcealCrypto.java
public ConcealCrypto create(){
if (this.context == null){
throw new RuntimeException("Context cannot be null");
}
mEntityPassword = Entity.create(CipherUtils.obscureEncodeSixFourString(mEntityPasswordRaw.getBytes()));
makeKeyChain = new SharedPrefsBackedKeyChain(this.context.get(),(mKeyChain==null)?CryptoConfig.KEY_256:mKeyChain);
if (mKeyChain == null) {
crypto = AndroidConceal.get().createDefaultCrypto(makeKeyChain);
} else if (mKeyChain == CryptoConfig.KEY_128) {
crypto = AndroidConceal.get().createCrypto128Bits(makeKeyChain);
} else {
crypto = AndroidConceal.get().createCrypto256Bits(makeKeyChain);
}
return new ConcealCrypto(this);
}
项目:My-Android-Base-Code
文件:PreferencesRepository.java
@SuppressLint("CommitPrefEdits")
public PreferencesRepository(Context context) {
mContext = context;
concealPrefRepository = new ConcealPrefRepository.PreferencesBuilder(mContext)
.useDefaultPrefStorage()
.sharedPrefsBackedKeyChain(CryptoConfig.KEY_256)
.enableCrypto(true,true)
.createPassword(mContext.getString(R.string.app_name))
.setFolderName(mContext.getString(R.string.app_name))
.create();
concealEditor = new ConcealPrefRepository.Editor();
}
项目:Patrons
文件:ConcealIntPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
final SharedPreferences prefs =
PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
final Crypto crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
factory = new ConcealPreferenceFactory(crypto, prefs);
}
项目:Patrons
文件:ConcealFloatPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealStringPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealBooleanPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealLongPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealStringSetPreferenceTest.java
@Before public void setUp() throws Exception {
SoLoader.init(InstrumentationRegistry.getContext(), false);
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealIntPreferenceTest.java
@Before public void setUp() throws Exception {
final SharedPreferences prefs =
PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
final Crypto crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
factory = new ConcealPreferenceFactory(crypto, prefs);
}
项目:Patrons
文件:ConcealFloatPreferenceTest.java
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealStringPreferenceTest.java
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealBooleanPreferenceTest.java
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealLongPreferenceTest.java
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:Patrons
文件:ConcealStringSetPreferenceTest.java
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
项目:MVP-Android
文件:PreferencesRepository.java
@Inject
public PreferencesRepository(Context context) {
mContext = context;
concealPrefRepository = new ConcealPrefRepository.PreferencesBuilder(mContext)
.useDefaultPrefStorage()
.sharedPrefsBackedKeyChain(CryptoConfig.KEY_256)
.enableCrypto(true,true)
.createPassword(mContext.getString(R.string.app_name))
.setFolderName(mContext.getString(R.string.app_name))
.create();
concealEditor = new ConcealPrefRepository.Editor();
}
项目:encryptedprefs
文件:ICSNativeStringEncryption.java
ICSNativeStringEncryption(String password) {
this.password = password;
this.hashing = new Hashing();
this.encoding = new Encoding();
SystemNativeCryptoLibrary nativeCryptoLibrary = new SystemNativeCryptoLibrary();
MemoryKeyChain keyChain = new MemoryKeyChain(CryptoConfig.KEY_256, password, nativeCryptoLibrary);
this.crypto = new Crypto(keyChain, nativeCryptoLibrary, CryptoConfig.KEY_256);
}
项目:secure-preferences
文件:SecurePreferences.java
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
);
}
项目:secure-preferences
文件:SecurePreferences.java
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
);
}
项目:ConcealSharedPreference-Android
文件:ConcealCrypto.java
public ConcealCrypto(Context context,CryptoConfig config){
keyChain = new SharedPrefsBackedKeyChain(context,config==null?CryptoConfig.KEY_256:config);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
项目:ConcealSharedPreference-Android
文件:ConcealCrypto.java
public CryptoBuilder setKeyChain(CryptoConfig config){
this.mKeyChain = config;
return this;
}
项目:encryptedprefs
文件:MemoryKeyChain.java
MemoryKeyChain(CryptoConfig cryptoConfig, String password, NativeCryptoLibrary nativeCryptoLibrary) {
this.cryptoConfig = cryptoConfig;
this.password = password;
this.nativeCryptoLibrary = nativeCryptoLibrary;
this.secureRandom = new FixedSecureRandom();
}
项目:LsPush
文件:BeeConcealKeyChain.java
public BeeConcealKeyChain(Context context) {
mSharedPreferences = context.getSharedPreferences(LSPUSH_BEE, Context.MODE_PRIVATE);
mSecureRandom = new FixedSecureRandom();
mCryptoConfig = CryptoConfig.KEY_256;
}
项目:react-native-keychain
文件:CipherStorageFacebookConceal.java
public CipherStorageFacebookConceal(ReactApplicationContext reactContext) {
KeyChain keyChain = new SharedPrefsBackedKeyChain(reactContext, CryptoConfig.KEY_256);
this.crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
项目:hawk
文件:ConcealEncryption.java
public ConcealEncryption(Context context) {
SharedPrefsBackedKeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
项目:hawk
文件:ConcealTest.java
@Before public void setup() {
Context context = InstrumentationRegistry.getContext();
SharedPrefsBackedKeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
项目:ConcealSharedPreference-Android
文件:ConcealPrefRepository.java
/**
* Use Conceal keychain
* @param keyChain Cryptography type
* @return PreferencesBuilder
*/
public PreferencesBuilder sharedPrefsBackedKeyChain(CryptoConfig keyChain){
mKeyChain = keyChain;
return this;
}