1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 //! This module is used to manage the life cycle of Asset. 17 18 pub mod crypto; 19 pub mod crypto_manager; 20 pub mod secret_key; 21 22 use asset_definition::Accessibility; 23 24 #[repr(C)] 25 struct HksBlob { 26 size: u32, 27 data: *const u8, 28 } 29 30 #[repr(C)] 31 struct OutBlob { 32 size: u32, 33 data: *mut u8, 34 } 35 36 #[repr(C)] 37 struct KeyId { 38 user_id: i32, 39 alias: HksBlob, 40 accessibility: Accessibility, 41 } 42 43 impl KeyId { new(user_id: i32, alias: HksBlob, accessibility: Accessibility) -> Self44 fn new(user_id: i32, alias: HksBlob, accessibility: Accessibility) -> Self { 45 Self { user_id, alias, accessibility } 46 } 47 } 48