@exodus/keystore-mobile
保障密钥价值存储实施保密管理.
使用量
import { Platform } from 'react-native'
import createKeystore from '@exodus/keystore-mobile'
import * as reactNativeKeychain from '@exodus/react-native-keychain'
const keystore = createKeystore({
reactNativeKeychain,
platform: Platform.OS,
})
const horcrux = await keystore.getSecret('horcrux')
选项
认证Prompt ? : {标题,字幕,描述,取消}{}}{ (){{{{}}
在读取受访问控制保护的秘密时显示系统认证提示的复制 。 传到 getInternetCredentials 每页 getSecret 电话 提供一个函数来解析每个读取的懒散副本,例如返回当前语言的翻译字符串。 省略时, react-native-keychain 返回到默认副本.
方法
获取Secret( 键: 字符串): 保证“ 任何未定义的 QQ ”
从密钥取出一个秘密 .
setSecret( 关键: 字符串, 值: 任何, 选择? ): {访问控制, 可访问, 访问组, 安全级别} : 答应
参见支持的值 opts 这里: https://github.com/Exodus Movement/react-native-keychain?tab=readme-ov-file#可选办法 互联网档案馆的存檔,存档日期2013-12-11
默认值 opts数字 :
// ios/android:
accessible: RNKeychain.ACCESSIBLE.WHEN_UNLOCKED,
// android:
securityLevel: RNKeychain.SECURITY_LEVEL.SECURE_SOFTWARE
删除Secret(键:字符串):承诺
从键盘中删除一个密钥 .
锁定 (): 承诺
锁上钥匙 所有电话都会挂到 unlock() 名为.
解锁(:承诺)
解锁密钥并允许通过所有待定的呼叫 .