/base/security/asset/services/db_operator/src/ |
H A D | transaction.rs | 19 use asset_definition::Result; 37 pub(crate) fn begin(&mut self) -> Result<()> { 42 pub(crate) fn rollback(self) -> Result<()> { 47 pub(crate) fn commit(self) -> Result<()> {
|
H A D | database_file_upgrade.rs | 22 use asset_definition::{log_throw_error, ErrCode, Extension, Result, Value}; 50 pub fn construct_splited_db_name(owner_type: OwnerType, owner_info: &[u8], is_ce: bool) -> Result<String> { in construct_splited_db_name() 76 fn get_db_before_split(user_id: i32) -> Result<Database> { in get_db_before_split() 80 fn get_value_from_db_map(db_map: &DbMap, key: &str) -> Result<Value> { in get_value_from_db_map() 87 fn remove_old_db(user_id: i32) -> Result<()> { in remove_old_db() 98 fn get_new_db(user_id: i32, info_map: &DbMap) -> Result<Database> { in get_new_db() 108 pub fn trigger_db_upgrade(user_id: i32, is_ce: bool) -> Result<()> { in trigger_db_upgrade() 125 fn construct_old_query_condition(info_map: &DbMap) -> Result<DbMap> { in construct_old_query_condition() 132 fn calculate_batch_split_times(old_data_query_condition: &DbMap, old_db: &mut Database) -> Result<u32> { in calculate_batch_split_times() 142 ) -> Result<()> { in migrate_data() [all...] |
H A D | database.rs | 25 use asset_definition::{log_throw_error, AssetMap, ErrCode, Extension, Result, Tag, Value}; 104 pub type UpgradeDbCallback = fn(db: &Database, old_ver: u32, new_ver: u32) -> Result<()>; 135 fn check_validity_of_db_key(path: &str, user_id: i32) -> Result<()> { in check_validity_of_db_key() 144 pub(crate) fn get_db(user_id: i32, db_name: &str, upgrade_db_version: u32, db_key: Option<&DbKey>) -> Result<Database> { 160 pub(crate) fn get_normal_db(user_id: i32, db_name: &str, is_ce: bool) -> Result<Database> { 185 pub fn create_db_instance(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<Database> { in create_db_instance() 210 pub fn build(user_id: i32, owner_type: OwnerType, owner_info: &[u8], is_ce: bool) -> Result<Database> { in build() 219 pub fn build_with_file_name(user_id: i32, db_name: &str, is_ce: bool) -> Result<Database> { in build_with_file_name() 225 pub fn check_db_accessible(path: String, user_id: i32, db_name: String, db_key: Option<&DbKey>) -> Result<()> { in check_db_accessible() 238 pub(crate) fn open(&mut self) -> Result<()> { [all...] |
H A D | table.rs | 22 use asset_definition::{log_throw_error, Conversion, DataType, ErrCode, Result, Value}; 43 fn bind_datas(datas: &DbMap, stmt: &Statement, index: &mut i32) -> Result<()> { in bind_datas() 51 fn bind_where_datas(datas: &DbMap, stmt: &Statement, index: &mut i32) -> Result<()> { in bind_where_datas() 63 fn bind_where_with_specific_condifion(datas: &[Value], stmt: &Statement, index: &mut i32) -> Result<()> { in bind_where_with_specific_condifion() 191 fn get_column_info(columns: &'static [ColumnInfo], db_column: &str) -> Result<&'static ColumnInfo> { in get_column_info() 205 pub(crate) fn exist(&self) -> Result<bool> { 217 pub(crate) fn delete(&self) -> Result<()> { 224 pub(crate) fn create_with_version(&self, columns: &[ColumnInfo], version: u32) -> Result<()> { 257 pub(crate) fn create(&self, columns: &[ColumnInfo]) -> Result<()> { 261 pub(crate) fn upgrade(&self, ver: u32, columns: &[UpgradeColumnInfo]) -> Result<()> { [all...] |
/base/security/asset/interfaces/inner_kits/rs/src/ |
H A D | lib.rs | 28 fn get_remote() -> Result<RemoteObj> { in get_remote() 48 pub fn build() -> Result<Self> { in build() 54 pub fn add(&self, attributes: &AssetMap) -> Result<()> { in add() 63 pub fn remove(&self, query: &AssetMap) -> Result<()> { in remove() 72 pub fn update(&self, query: &AssetMap, attributes_to_update: &AssetMap) -> Result<()> { in update() 82 pub fn pre_query(&self, query: &AssetMap) -> Result<Vec<u8>> { in pre_query() 92 pub fn query(&self, query: &AssetMap) -> Result<Vec<AssetMap>> { in query() 102 pub fn post_query(&self, query: &AssetMap) -> Result<()> { in post_query() 110 fn send_request(&self, mut parcel: MsgParcel, ipc_code: IpcCode) -> Result<MsgParcel> { in send_request()
|
/base/security/asset/frameworks/os_dependency/file/src/ |
H A D | de_operator.rs | 18 use asset_definition::{log_throw_error, ErrCode, Result}; 28 fn is_user_de_dir_exist(user_id: i32) -> Result<bool> { in is_user_de_dir_exist() 34 pub fn create_user_de_dir(user_id: i32) -> Result<()> { in create_user_de_dir() 56 pub fn delete_user_de_dir(user_id: i32) -> Result<()> { in delete_user_de_dir() 77 pub fn get_de_user_dbs(user_id: i32) -> Result<Vec<String>> { in get_de_user_dbs()
|
H A D | ce_operator.rs | 18 use asset_definition::{log_throw_error, ErrCode, Result}; 32 pub fn is_db_key_cipher_file_exist(user_id: i32) -> Result<bool> { in is_db_key_cipher_file_exist() 38 pub fn read_db_key_cipher(user_id: i32) -> Result<Vec<u8>> { in read_db_key_cipher() 54 pub fn write_db_key_cipher(user_id: i32, db_key_cipher: &Vec<u8>) -> Result<()> { in write_db_key_cipher() 70 pub fn remove_ce_files(user_id: i32) -> Result<()> { in remove_ce_files() 90 pub fn get_ce_user_dbs(user_id: i32) -> Result<Vec<String>> { in get_ce_user_dbs()
|
H A D | common.rs | 18 use asset_definition::{log_throw_error, ErrCode, Result}; 33 pub(crate) fn get_user_dbs(path_str: &str) -> Result<Vec<String>> { 46 pub fn is_file_exist(path_str: &str) -> Result<bool> { in is_file_exist()
|
/base/security/code_signature/services/key_enable/src/ |
H A D | file_utils.rs | 32 pub fn change_default_mode_file(path_file: &str) -> Result<(), CodeSignFileError> { in change_default_mode_file() 42 pub fn change_default_mode_directory(path_file: &str) -> Result<(), CodeSignFileError> { in change_default_mode_directory() 56 pub fn create_file_path(path_name: &str) -> Result<(), std::io::Error> { in create_file_path() 62 pub fn write_bytes_to_file(filename: &str, data: &[u8]) -> Result<(), std::io::Error> { in write_bytes_to_file() 68 pub fn load_bytes_from_file(filename: &str, buffer: &mut Vec<u8>) -> Result<(), std::io::Error> { in load_bytes_from_file() 78 pub fn delete_file_path(file_path: &str) -> Result<(), std::io::Error> { in delete_file_path()
|
H A D | cert_chain_utils.rs | 49 fn pem_to_x509(&self, pem: &str) -> Result<X509, openssl::error::ErrorStack> {
in pem_to_x509() 53 pub fn to_x509(&self) -> Result<Vec<X509>, openssl::error::ErrorStack> {
in to_x509() 60 pub fn to_x509_store(&self) -> Result<X509Store, openssl::error::ErrorStack> {
in to_x509_store() 71 pub fn to_der(&self) -> Result<Vec<Vec<u8>>, openssl::error::ErrorStack> {
in to_der()
|
H A D | profile_utils.rs | 116 ) -> Result<(String, String, u32), Box<dyn Error>> { in parse_pkcs7_data() 126 ) -> Result<Vec<u8>, Box<dyn Error>> { in verify_pkcs7_signature() 137 ) -> Result<(), Box<dyn Error>> { in validate_bundle_and_distribution_type() 172 ) -> Result<JsonValue, Box<dyn Error>> { in parse_and_validate_profile() 178 fn get_cert_details(profile_json: &JsonValue) -> Result<(String, String, u32), Box<dyn Error>> { in get_cert_details() 198 pub static ref UDID: Result<String, String> = init_udid(); 201 fn init_udid() -> Result<String, String> { in init_udid() 220 pub fn get_udid() -> Result<String, String> { in get_udid() 228 ) -> Result<(), Box<dyn Error>> { in verify_signers() 293 for entry in entries.filter_map(Result in get_paths_from_prefix() [all...] |
/base/security/asset/services/db_key_operator/src/ |
H A D | lib.rs | 20 use asset_definition::{log_throw_error, Accessibility, AuthType, ErrCode, Result}; 29 fn build_db_key_secret_key(user_id: i32) -> Result<SecretKey> { in build_db_key_secret_key() 39 pub fn generate_secret_key_if_needed(secret_key: &SecretKey) -> Result<()> { in generate_secret_key_if_needed() 68 fn decrypt_db_key_cipher(user_id: i32, db_key_cipher: &Vec<u8>) -> Result<DbKey> { in decrypt_db_key_cipher() 75 fn generate_db_key() -> Result<DbKey> { in generate_db_key() 85 fn encrypt_db_key(&self, user_id: i32) -> Result<Vec<u8>> { in encrypt_db_key() 95 pub fn check_existance(user_id: i32) -> Result<bool> { in check_existance() 100 pub fn get_db_key(user_id: i32) -> Result<DbKey> { in get_db_key()
|
/base/security/asset/services/core_service/src/operations/common/ |
H A D | argument_check.rs | 20 log_throw_error, Accessibility, AssetMap, AuthType, ConflictResolution, Conversion, ErrCode, OperationType, Result, 42 fn check_data_type(tag: &Tag, value: &Value) -> Result<()> { in check_data_type() 54 fn check_array_size(tag: &Tag, value: &Value, min: usize, max: usize) -> Result<()> { in check_array_size() 69 fn check_enum_variant<T: TryFrom<u32>>(tag: &Tag, value: &Value) -> Result<()> { in check_enum_variant() 84 fn check_valid_bits(tag: &Tag, value: &Value, min_bits: u32, max_bits: u32) -> Result<()> { in check_valid_bits() 100 fn check_number_range(tag: &Tag, value: &Value, min: u32, max: u32) -> Result<()> { in check_number_range() 115 fn check_tag_range(tag: &Tag, value: &Value, tags: &[Tag]) -> Result<()> { in check_tag_range() 132 fn check_user_id(tag: &Tag, value: &Value) -> Result<()> { in check_user_id() 144 fn check_data_value(tag: &Tag, value: &Value) -> Result<()> { in check_data_value() 178 pub(crate) fn check_value_validity(attrs: &AssetMap) -> Result<()> { [all...] |
H A D | permission_check.rs | 23 use asset_definition::{log_throw_error, AssetMap, ErrCode, Result, Tag}; 30 pub(crate) fn check_system_permission(attrs: &AssetMap) -> Result<()> {
|
/base/security/asset/frameworks/utils/src/ |
H A D | time.rs | 20 use asset_definition::{log_throw_error, ErrCode, Result}; 23 pub fn system_time_in_millis() -> Result<Vec<u8>> { in system_time_in_millis() 31 pub fn system_time_in_seconds() -> Result<u64> { in system_time_in_seconds()
|
/base/security/asset/services/core_service/src/operations/ |
H A D | operation_post_query.rs | 20 use asset_definition::{AssetMap, Extension, Result, Tag}; 27 fn check_arguments(query: &AssetMap) -> Result<()> { in check_arguments() 36 pub(crate) fn post_query(calling_info: &CallingInfo, handle: &AssetMap) -> Result<()> {
|
H A D | operation_add.rs | 28 log_throw_error, Accessibility, AssetMap, AuthType, ConflictResolution, ErrCode, Extension, LocalStatus, Result, 35 fn encrypt_secret(calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in encrypt_secret() 51 ) -> Result<()> { in resolve_conflict() 71 fn get_query_condition(calling_info: &CallingInfo, attrs: &AssetMap) -> Result<DbMap> { in get_query_condition() 80 fn add_system_attrs(db_data: &mut DbMap) -> Result<()> { in add_system_attrs() 103 fn check_accessibity_validity(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<()> { in check_accessibity_validity() 122 fn check_persistent_permission(attributes: &AssetMap) -> Result<()> { in check_persistent_permission() 132 fn check_arguments(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<()> { in check_arguments() 148 fn local_add(attributes: &AssetMap, calling_info: &CallingInfo) -> Result<()> { in local_add() 171 pub(crate) fn add(calling_info: &CallingInfo, attributes: &AssetMap) -> Result<()> { [all...] |
H A D | operation_remove.rs | 23 use asset_definition::{log_throw_error, AssetMap, ErrCode, Result, SyncStatus, SyncType, Value}; 29 fn add_system_attrs(db_data: &mut DbMap) -> Result<()> { in add_system_attrs() 39 fn check_arguments(attributes: &AssetMap) -> Result<()> { in check_arguments() 50 pub(crate) fn remove(calling_info: &CallingInfo, query: &AssetMap) -> Result<()> {
|
H A D | operation_update.rs | 24 use asset_definition::{log_throw_error, AssetMap, ErrCode, Extension, LocalStatus, Result, SyncStatus, Tag, Value}; 29 fn encrypt(calling_info: &CallingInfo, db_data: &DbMap) -> Result<Vec<u8>> { in encrypt() 46 fn add_attrs(update: &AssetMap, db_data: &mut DbMap) -> Result<()> { in add_attrs() 55 fn add_system_attrs(db_data: &mut DbMap) -> Result<()> { in add_system_attrs() 68 fn check_arguments(query: &AssetMap, attrs_to_update: &AssetMap) -> Result<()> { in check_arguments() 96 pub(crate) fn update(calling_info: &CallingInfo, query: &AssetMap, update: &AssetMap) -> Result<()> {
|
H A D | operation_query.rs | 27 log_throw_error, throw_error, AssetMap, AuthType, ErrCode, Extension, Result, ReturnType, Tag, Value, 32 fn into_asset_maps(db_results: &Vec<DbMap>) -> Result<Vec<AssetMap>> { in into_asset_maps() 42 fn upgrade_version(db: &mut Database, calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in upgrade_version() 62 fn decrypt_secret(calling_info: &CallingInfo, db_data: &mut DbMap) -> Result<()> { in decrypt_secret() 70 fn exec_crypto(calling_info: &CallingInfo, query: &AssetMap, db_data: &mut DbMap) -> Result<()> { in exec_crypto() 88 fn query_all(calling_info: &CallingInfo, db_data: &mut DbMap, query: &AssetMap) -> Result<Vec<AssetMap>> { in query_all() 142 pub(crate) fn query_attrs(calling_info: &CallingInfo, db_data: &DbMap, attrs: &AssetMap) -> Result<Vec<AssetMap>> { 160 fn check_arguments(attributes: &AssetMap) -> Result<()> { in check_arguments() 172 pub(crate) fn query(calling_info: &CallingInfo, query: &AssetMap) -> Result<Vec<AssetMap>> {
|
/base/sensors/sensor/rust/utils/socket_ipc_rust_ffi/src/ |
H A D | lib.rs | 26 pub type Result<T> = std::result::Result<T, i32>; types
|
/base/security/asset/services/core_service/src/ |
H A D | lib.rs | 33 use asset_definition::{log_throw_error, AssetMap, ErrCode, Result}; 108 async fn upgrade_process() -> Result<()> { 119 fn start_service(handler: Handler) -> Result<()> { in start_service() 172 fn add(&self, calling_info: &CallingInfo, attributes: &AssetMap) -> Result<()> { in add() 176 fn remove(&self, calling_info: &CallingInfo, query: &AssetMap) -> Result<()> { in remove() 180 fn update(&self, calling_info: &CallingInfo, query: &AssetMap, attributes_to_update: &AssetMap) -> Result<()> { in update() 184 fn pre_query(&self, calling_info: &CallingInfo, query: &AssetMap) -> Result<Vec<u8>> { in pre_query() 188 fn query(&self, calling_info: &CallingInfo, query: &AssetMap) -> Result<Vec<AssetMap>> { in query() 192 fn post_query(&self, calling_info: &CallingInfo, query: &AssetMap) -> Result<()> { in post_query()
|
/base/security/asset/services/crypto_manager/src/ |
H A D | crypto_manager.rs | 24 use asset_definition::{log_throw_error, ErrCode, Result}; 47 pub fn add(&mut self, crypto: Crypto) -> Result<()> { in add() 58 pub fn find(&mut self, calling_info: &CallingInfo, challenge: &Vec<u8>) -> Result<&Crypto> { in find() 93 fn remove_expired_crypto(&mut self) -> Result<()> { in remove_expired_crypto()
|
/base/security/asset/services/plugin/src/ |
H A D | asset_plugin.rs | 22 use asset_definition::{log_throw_error, ErrCode, Extension, Result}; 57 pub fn load_plugin(&self) -> Result<Box<dyn IAssetPlugin>> { in load_plugin() 114 fn get_db_name(attributes: &ExtDbMap, is_ce: bool) -> std::result::Result<String, u32> { in get_db_name() 124 fn init(&mut self, user_id: i32) -> std::result::Result<(), u32> { in init() 131 fn add(&mut self, attributes: &ExtDbMap) -> std::result::Result<i32, u32> { in add() 138 fn ce_add(&mut self, attributes: &ExtDbMap) -> std::result::Result<i32, u32> { in ce_add() 145 fn replace(&mut self, condition: &ExtDbMap, attributes: &ExtDbMap) -> std::result::Result<(), u32> { in replace() 152 fn ce_replace(&mut self, condition: &ExtDbMap, attributes: &ExtDbMap) -> std::result::Result<(), u32> { in ce_replace() 159 fn query(&mut self, attributes: &ExtDbMap) -> std::result::Result<Vec<ExtDbMap>, u32> { in query() 170 fn ce_query(&mut self, attributes: &ExtDbMap) -> std::result::Result<Ve [all...] |
/base/security/asset/frameworks/definition/src/ |
H A D | extension.rs | 24 Result, Tag, Value, 100 fn get_bool_attr(&self, key: &K) -> Result<bool> { in get_bool_attr() 108 fn get_enum_attr<T: TryFrom<u32, Error = AssetError>>(&self, key: &K) -> Result<T> { in get_enum_attr() 116 fn get_num_attr(&self, key: &K) -> Result<u32> { in get_num_attr() 124 fn get_bytes_attr(&self, key: &K) -> Result<&Vec<u8>> { in get_bytes_attr() 134 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { in fmt()
|