1# Certificate Management Dialog Box Development
2
3> **NOTE**
4>
5> This guide applies to the SDK of API version 13 or later.
6
7You can use the **certificateManagerDialog** APIs to open the certificate management dialog box and perform certificate management, such as installing, storing, using, and destroying a certificate.
8
9
10## Available APIs
11
12For details about the APIs, see [Certificate Management Dialog Box](../../reference/apis-device-certificate-kit/js-apis-certManagerDialog.md).
13
14The following table describes the commonly used APIs.
15
16| Instance         | API                                                      | Description                                        |
17| --------------- | ------------------------------------------------------------ | -------------------------------------------- |
18| certificateManagerDialog        | openCertificateManagerDialog(context: common.Context, pageType: CertificateDialogPageType): Promise\<void> | Opens the certificate management dialog box and displays the page of the specified type. This API uses a promise to return the result. |
19
20## How to Develop
21
221. Apply for the ohos.permission.ACCESS_CERT_MANAGER permission. For details, see [Declaring Permissions](../AccessToken/declare-permissions.md).
23
242. Import modules.
25
26   ```ts
27   import certificateManagerDialog from '@ohos.security.certManagerDialog';
28   import { BusinessError } from '@kit.BasicServicesKit';
29   import { common } from '@kit.AbilityKit';
30   ```
313. Open the certificate management dialog box.
32
33   ```ts
34   async function certificateManagerDialogSample() {
35	/* context is application context information, which is obtained by the caller. The context here is only an example. */
36	let context: common.Context = getContext(this);
37	/* pageType specifies the type of the page to display. In this example, pageType is PAGE_MAIN, which indicates the main page of the Certificate Manager application. */
38	let pageType: certificateManagerDialog.CertificateDialogPageType = certificateManagerDialog.CertificateDialogPageType.PAGE_MAIN;
39	try {
40	  certificateManagerDialog.openCertificateManagerDialog(context, pageType).then(() => {
41		console.info('Succeeded in opening certificate manager dialog.');
42	  }).catch((err: BusinessError) => {
43		console.error(`Failed to open certificate manager dialog. Code: ${err.code}, message: ${err.message}`);
44	  })
45	} catch (error) {
46	  console.error(`Failed to open certificate manager dialog. Code: ${error.code}, message: ${error.message}`);
47	}
48   }
49   ```
50