本文整理汇总了Java中com.facebook.crypto.CryptoConfig类的典型用法代码示例。如果您正苦于以下问题:Java CryptoConfig类的具体用法?Java CryptoConfig怎么用?Java CryptoConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CryptoConfig类属于com.facebook.crypto包,在下文中一共展示了CryptoConfig类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
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);
}
开发者ID:afiqiqmal,项目名称:ConcealSharedPreference-Android,代码行数:20,代码来源:ConcealCrypto.java
示例2: onCreate
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
concealPrefRepository = new ConcealPrefRepository.PreferencesBuilder(this)
.useDefaultPrefStorage()
.sharedPrefsBackedKeyChain(CryptoConfig.KEY_256)
.enableCrypto(false,true)
.createPassword("[email protected]")
.setPrefListener(this)
.create();
}
开发者ID:afiqiqmal,项目名称:ConcealSharedPreference-Android,代码行数:14,代码来源:BaseActivity.java
示例3: PreferencesRepository
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@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();
}
开发者ID:afiqiqmal,项目名称:My-Android-Base-Code,代码行数:14,代码来源:PreferencesRepository.java
示例4: setUp
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@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);
}
开发者ID:prolificinteractive,项目名称:Patrons,代码行数:16,代码来源:ConcealIntPreferenceTest.java
示例5: setUp
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@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
));
}
开发者ID:prolificinteractive,项目名称:Patrons,代码行数:12,代码来源:ConcealFloatPreferenceTest.java
示例6: setUp
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@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);
}
开发者ID:prolificinteractive,项目名称:Patrons,代码行数:13,代码来源:ConcealIntPreferenceTest.java
示例7: setUp
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@Before public void setUp() throws Exception {
prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
crypto = AndroidConceal
.get()
.createDefaultCrypto(new SharedPrefsBackedKeyChain(
InstrumentationRegistry.getContext(),
CryptoConfig.KEY_256
));
}
开发者ID:prolificinteractive,项目名称:Patrons,代码行数:10,代码来源:ConcealFloatPreferenceTest.java
示例8: PreferencesRepository
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@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();
}
开发者ID:afiqiqmal,项目名称:MVP-Android,代码行数:14,代码来源:PreferencesRepository.java
示例9: ICSNativeStringEncryption
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
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);
}
开发者ID:marius-bardan,项目名称:encryptedprefs,代码行数:10,代码来源:ICSNativeStringEncryption.java
示例10: build
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
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
);
}
开发者ID:KaKaVip,项目名称:secure-preferences,代码行数:16,代码来源:SecurePreferences.java
示例11: ConcealCrypto
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
public ConcealCrypto(Context context,CryptoConfig config){
keyChain = new SharedPrefsBackedKeyChain(context,config==null?CryptoConfig.KEY_256:config);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
开发者ID:afiqiqmal,项目名称:ConcealSharedPreference-Android,代码行数:5,代码来源:ConcealCrypto.java
示例12: setKeyChain
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
public CryptoBuilder setKeyChain(CryptoConfig config){
this.mKeyChain = config;
return this;
}
开发者ID:afiqiqmal,项目名称:ConcealSharedPreference-Android,代码行数:5,代码来源:ConcealCrypto.java
示例13: MemoryKeyChain
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
MemoryKeyChain(CryptoConfig cryptoConfig, String password, NativeCryptoLibrary nativeCryptoLibrary) {
this.cryptoConfig = cryptoConfig;
this.password = password;
this.nativeCryptoLibrary = nativeCryptoLibrary;
this.secureRandom = new FixedSecureRandom();
}
开发者ID:marius-bardan,项目名称:encryptedprefs,代码行数:7,代码来源:MemoryKeyChain.java
示例14: BeeConcealKeyChain
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
public BeeConcealKeyChain(Context context) {
mSharedPreferences = context.getSharedPreferences(LSPUSH_BEE, Context.MODE_PRIVATE);
mSecureRandom = new FixedSecureRandom();
mCryptoConfig = CryptoConfig.KEY_256;
}
开发者ID:TomeOkin,项目名称:LsPush,代码行数:6,代码来源:BeeConcealKeyChain.java
示例15: CipherStorageFacebookConceal
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
public CipherStorageFacebookConceal(ReactApplicationContext reactContext) {
KeyChain keyChain = new SharedPrefsBackedKeyChain(reactContext, CryptoConfig.KEY_256);
this.crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
开发者ID:oblador,项目名称:react-native-keychain,代码行数:5,代码来源:CipherStorageFacebookConceal.java
示例16: ConcealEncryption
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
public ConcealEncryption(Context context) {
SharedPrefsBackedKeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
开发者ID:orhanobut,项目名称:hawk,代码行数:5,代码来源:ConcealEncryption.java
示例17: setup
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
@Before public void setup() {
Context context = InstrumentationRegistry.getContext();
SharedPrefsBackedKeyChain keyChain = new SharedPrefsBackedKeyChain(context, CryptoConfig.KEY_256);
crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}
开发者ID:orhanobut,项目名称:hawk,代码行数:6,代码来源:ConcealTest.java
示例18: sharedPrefsBackedKeyChain
import com.facebook.crypto.CryptoConfig; //导入依赖的package包/类
/**
* Use Conceal keychain
* @param keyChain Cryptography type
* @return PreferencesBuilder
*/
public PreferencesBuilder sharedPrefsBackedKeyChain(CryptoConfig keyChain){
mKeyChain = keyChain;
return this;
}
开发者ID:afiqiqmal,项目名称:ConcealSharedPreference-Android,代码行数:10,代码来源:ConcealPrefRepository.java
注:本文中的com.facebook.crypto.CryptoConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论