中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
关系型数据库如何进行加密?
微信扫码分享
import relationalStore from '@ohos.data.relationalStore'; let store: relationalStore.RdbStore; let context = getContext(this); const STORE_CONFIG: relationalStore.StoreConfig = { name: 'RdbTest.db', securityLevel: relationalStore.SecurityLevel.S1, encrypt: true//true:设置数据库加密 }; relationalStore.getRdbStore(context, STORE_CONFIG, (err, rdbStore) => { store = rdbStore; if (err) { console.error(`Failed to get RdbStore. Code:${err.code},message:${err.message}`); return; } console.info('Succeeded in getting RdbStore.'); })