1e41f4b71Sopenharmony_ci# Obtaining Key Properties (ArkTS)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciThis topic describes how to obtain properties of a key. Before the operation, ensure that the key exists in HUKS.
5e41f4b71Sopenharmony_ci>**NOTE**<br>
6e41f4b71Sopenharmony_ci> The mini-system devices do not support the operation for obtaining key properties.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci## How to Develop
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci1. Set the key alias (**keyAlias**), which cannot exceed 128 bytes.
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci2. Use [getKeyItemProperties](../../reference/apis-universal-keystore-kit/js-apis-huks.md#huksgetkeyitemproperties9) to obtain the properties of the key based on **keyAlias** and **options**. 
13e41f4b71Sopenharmony_ci   **options** is a reserved parameter and is left empty currently.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci3. You can find the key properties in the **properties** field in the [HuksReturnResult](../../reference/apis-universal-keystore-kit/js-apis-huks.md#huksreturnresult9) object.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci```ts
18e41f4b71Sopenharmony_ciimport { huks } from '@kit.UniversalKeystoreKit';
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci/* 1. Set the key alias. */
21e41f4b71Sopenharmony_cilet keyAlias = 'keyAlias';
22e41f4b71Sopenharmony_ci/* Leave options empty. */
23e41f4b71Sopenharmony_cilet emptyOptions: huks.HuksOptions = {
24e41f4b71Sopenharmony_ci  properties: []
25e41f4b71Sopenharmony_ci};
26e41f4b71Sopenharmony_citry {
27e41f4b71Sopenharmony_ci  /* 2. Obtain key properties. */
28e41f4b71Sopenharmony_ci  huks.getKeyItemProperties(keyAlias, emptyOptions, (error, data) => {
29e41f4b71Sopenharmony_ci    if (error) {
30e41f4b71Sopenharmony_ci      console.error(`callback: getKeyItemProperties failed, ` + JSON.stringify(error));
31e41f4b71Sopenharmony_ci    } else {
32e41f4b71Sopenharmony_ci      console.info(`callback: getKeyItemProperties success, data = ${JSON.stringify(data)}`);
33e41f4b71Sopenharmony_ci    }
34e41f4b71Sopenharmony_ci  });
35e41f4b71Sopenharmony_ci} catch (error) {
36e41f4b71Sopenharmony_ci  console.error(`callback: getKeyItemProperties input arg invalid, ` + JSON.stringify(error));
37e41f4b71Sopenharmony_ci}
38e41f4b71Sopenharmony_ci```
39