1# Security Component Manager Service
2
3## Introduction
4
5The security components are a set of ArkUI components provided by OpenHarmony, like <**Button**> and <**Text**>. You can integrate them to your application UI.
6When 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.
7
8For 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.
9
10The following figure illustrates the working mechanism of security components.
11
12![security_component](figures/security_component.png)
13
14The 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.
15
16The security component manager service provides the following functions:
17
18- Provides native interfaces for registering or unregistering a security component, and granting temporary permissions to the application.
19
20- Checks the validity of security components. Only valid security components can be authorized successfully.
21
22- Provides native interfaces for the mediaLibrary service to query temporary permissions.
23
24- Provides APIs and adaptation layer for vendors to customize security enhancement functions.
25
26
27## Directory Structure
28
29```
30/base/security/security_component_manager
31├── frameworks                  # Code of basic functionalities
32│   ├── common                  # Common code
33│   ├── enhance_adapter         # Adaptation code for capability enhancement
34│   └── security_component      # Framework code of the security component service
35├── interfaces                  # APIs
36│   └── inner_api               # Internal APIs
37│       ├── enhance_kits        # APIs for security component configuration
38│       └── security_component  # Security component service APIs
39└── services                    # Services
40    └── security_component_service/sa
41        └── sa_main             # System ability code of the security components
42
43```
44
45## Usage
46### Available APIs
47
48| **API**| **Description**|
49| --- | --- |
50| int32_t RegisterSecurityComponent(SecCompType type, const std::string& componentInfo, int32_t& scId); | Registers a security component.|
51| int32_t UpdateSecurityComponent(int32_t scId, const std::string& componentInfo); | Updates security component information.|
52| int32_t UnregisterSecurityComponent(int32_t scId); | Unregisters a security component.|
53| int32_t ReportSecurityComponentClickEvent(int32_t scId, const std::string& componentInfo, const SecCompClickEvent& clickInfo, sptr&lt;IRemoteObject&gt; callerToken); | Reports a click event to apply for temporary authorization.|
54| int32_t SetEnhanceCfg(uint8_t* cfg, uint32_t cfgLen); | Sets enhanced configuration of the security component for multimodal services.|
55| 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.|
56| bool ReduceAfterVerifySavePermission(AccessToken::AccessTokenID tokenId); | Cancels the saving of the component permissions after verification.|
57
58## Repositories Involved
59
60**[arkui\_ace\_engine](https://gitee.com/openharmony/arkui_ace_engine/blob/master/README.md)**
61
62**[multimodalinput\_input](https://gitee.com/openharmony/multimodalinput_input/blob/master/README.md)**
63