1d8a29711Sopenharmony_ci# Security Component Manager Service 2d8a29711Sopenharmony_ci 3d8a29711Sopenharmony_ci## Introduction 4d8a29711Sopenharmony_ci 5d8a29711Sopenharmony_ciThe security components are a set of ArkUI components provided by OpenHarmony, like <**Button**> and <**Text**>. You can integrate them to your application UI. 6d8a29711Sopenharmony_ciWhen a security component is clicked, the application is granted temporary permissions and can access the user's private data without applying for permissions. This minimizes the interference of the authorization pop-up windows to users. 7d8a29711Sopenharmony_ci 8d8a29711Sopenharmony_ciFor example, if you integrate the **LocationButton** component into your application, you do not need to apply for the location permission. When the user clicks this component, the application can obtain the temporary location permission in the foreground and call the location service API to obtain location information. 9d8a29711Sopenharmony_ci 10d8a29711Sopenharmony_ciThe following figure illustrates the working mechanism of security components. 11d8a29711Sopenharmony_ci 12d8a29711Sopenharmony_ci 13d8a29711Sopenharmony_ci 14d8a29711Sopenharmony_ciThe security components are implemented by UX implementation and security component manager service. Integrated in the ArkUI framework, the UX implementation is responsible for drawing components. The security component manager service manages the security components, performs validity checks, and grants temporary permissions. 15d8a29711Sopenharmony_ci 16d8a29711Sopenharmony_ciThe security component manager service provides the following functions: 17d8a29711Sopenharmony_ci 18d8a29711Sopenharmony_ci- Provides native interfaces for registering or unregistering a security component, and granting temporary permissions to the application. 19d8a29711Sopenharmony_ci 20d8a29711Sopenharmony_ci- Checks the validity of security components. Only valid security components can be authorized successfully. 21d8a29711Sopenharmony_ci 22d8a29711Sopenharmony_ci- Provides native interfaces for the mediaLibrary service to query temporary permissions. 23d8a29711Sopenharmony_ci 24d8a29711Sopenharmony_ci- Provides APIs and adaptation layer for vendors to customize security enhancement functions. 25d8a29711Sopenharmony_ci 26d8a29711Sopenharmony_ci 27d8a29711Sopenharmony_ci## Directory Structure 28d8a29711Sopenharmony_ci 29d8a29711Sopenharmony_ci``` 30d8a29711Sopenharmony_ci/base/security/security_component_manager 31d8a29711Sopenharmony_ci├── frameworks # Code of basic functionalities 32d8a29711Sopenharmony_ci│ ├── common # Common code 33d8a29711Sopenharmony_ci│ ├── enhance_adapter # Adaptation code for capability enhancement 34d8a29711Sopenharmony_ci│ └── security_component # Framework code of the security component service 35d8a29711Sopenharmony_ci├── interfaces # APIs 36d8a29711Sopenharmony_ci│ └── inner_api # Internal APIs 37d8a29711Sopenharmony_ci│ ├── enhance_kits # APIs for security component configuration 38d8a29711Sopenharmony_ci│ └── security_component # Security component service APIs 39d8a29711Sopenharmony_ci└── services # Services 40d8a29711Sopenharmony_ci └── security_component_service/sa 41d8a29711Sopenharmony_ci └── sa_main # System ability code of the security components 42d8a29711Sopenharmony_ci 43d8a29711Sopenharmony_ci``` 44d8a29711Sopenharmony_ci 45d8a29711Sopenharmony_ci## Usage 46d8a29711Sopenharmony_ci### Available APIs 47d8a29711Sopenharmony_ci 48d8a29711Sopenharmony_ci| **API**| **Description**| 49d8a29711Sopenharmony_ci| --- | --- | 50d8a29711Sopenharmony_ci| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | Registers a security component.| 51d8a29711Sopenharmony_ci| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | Updates security component information.| 52d8a29711Sopenharmony_ci| int32_t UnregisterSecurityComponent(int32_t scId); | Unregisters a security component.| 53d8a29711Sopenharmony_ci| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& clickInfo, sptr<IRemoteObject> callerToken); | Reports a click event to apply for temporary authorization.| 54d8a29711Sopenharmony_ci| int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); | Sets enhanced configuration of the security component for multimodal services.| 55d8a29711Sopenharmony_ci| int32_t GetPointerEventEnhanceData(void* data, uint32_t dataLen, uint8_t* enhanceData, uint32_t& enHancedataLen); | Obtains security enhancement data of the click event for multimodal services.| 56d8a29711Sopenharmony_ci| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | Cancels the saving of the component permissions after verification.| 57d8a29711Sopenharmony_ci 58d8a29711Sopenharmony_ci## Repositories Involved 59d8a29711Sopenharmony_ci 60d8a29711Sopenharmony_ci**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README.md)** 61d8a29711Sopenharmony_ci 62d8a29711Sopenharmony_ci**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README.md)** 63