本文整理汇总了Java中com.facebook.crypto.keychain.KeyChain类的典型用法代码示例。如果您正苦于以下问题:Java KeyChain类的具体用法?Java KeyChain怎么用?Java KeyChain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyChain类属于com.facebook.crypto.keychain包,在下文中一共展示了KeyChain类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import com.facebook.crypto.keychain.KeyChain; //导入依赖的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
);
}
示例2: SecurePreferences
import com.facebook.crypto.keychain.KeyChain; //导入依赖的package包/类
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);
}
示例3: CipherStorageFacebookConceal
import com.facebook.crypto.keychain.KeyChain; //导入依赖的package包/类
public CipherStorageFacebookConceal(ReactApplicationContext reactContext) {
KeyChain keyChain = new SharedPrefsBackedKeyChain(reactContext, CryptoConfig.KEY_256);
this.crypto = AndroidConceal.get().createDefaultCrypto(keyChain);
}