

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# KMU를 사용하여 AWS CloudHSM 키의 속성 설정
<a name="key_mgmt_util-setAttribute"></a>

 AWS CloudHSM key\_mgmt\_util의 **setAttribute** 명령을 사용하여 현재 세션에서만 유효한 키를 삭제할 때까지 존재하는 영구 키로 변환합니다. 이 변환은 키의 토큰 속성(`OBJ_ATTR_TOKEN`) 값을 false(`0`)에서 true(`1`)로 변경함으로써 이루어집니다. 본인이 소유한 키의 속성만 변경할 수 있습니다.

cloudhsm\_mgmt\_util에서 **setAttribute** 명령을 사용하여 label, wrap, unwrap, encrypt 및 decrypt 속성도 변경할 수 있습니다.

key\_mgmt\_util 명령을 실행하기 전에 [key\_mgmt\_util을 시작](key_mgmt_util-setup.md#key_mgmt_util-start)하고 CU(Crypto User)로 HSM에 [로그인](key_mgmt_util-log-in.md)해야 합니다.

## 구문
<a name="setAttribute-syntax"></a>

```
setAttribute -h 

setAttribute -o {{<object handle>}} 
             -a 1
```

## 예제
<a name="setAttribute-examples"></a>

이 예제는 세션 키를 영구 키로 변환하는 방법을 보여 줍니다.

첫 번째 명령은 [genSymKey](key_mgmt_util-genSymKey.md)의 `-sess` 파라미터를 사용하여 현재 세션에서만 유효한 192비트 AES 키를 생성합니다. 출력은 새 세션 키의 키 핸들이 `262154`임을 보여 줍니다.

```
Command: genSymKey -t 31 -s 24 -l tmpAES -sess
      
        Cfm3GenerateSymmetricKey returned: 0x00 : HSM Return: SUCCESS

        Symmetric Key Created.  Key Handle: 262154

        Cluster Error Status
        Node id 1 and err state 0x00000000 : HSM Return: SUCCESS
```

이 명령은 [findKey](key_mgmt_util-findKey.md)를 사용하여 현재 세션에서 세션 키를 찾습니다. 출력은 키 `262154`가 세션 키임을 확인합니다.

```
Command:  findKey -sess 1

Total number of keys present 1

 number of keys matched from start index 0::0
262154

        Cluster Error Status
        Node id 1 and err state 0x00000000 : HSM Return: SUCCESS
        Node id 0 and err state 0x00000000 : HSM Return: SUCCESS

        Cfm3FindKey returned: 0x00 : HSM Return: SUCCESS
```

이 명령은 **setAttribute**를 사용하여 키 `262154`를 세션 키에서 영구 키로 변환합니다. 이를 위해 이 명령은 키의 토큰 속성(`OBJ_ATTR_TOKEN`) 값을 `0`(false)에서 `1`(true)로 변경합니다. 키 속성 해석에 대한 도움말은 [AWS CloudHSM KMU에 대한 키 속성 참조](key-attribute-table.md) 섹션을 참조하십시오.

이 명령은 `-o` 파라미터를 사용하여 키 핸들(`262154`)을 지정하고, `-a` 파라미터를 사용하여 토큰 속성(`1`)을 나타내는 상수를 지정합니다. 명령을 실행하면 토큰 속성의 값을 묻는 메시지가 표시됩니다. 유일한 유효 값은 `1`(true)로서 영구 키의 값입니다.

```
Command: setAttribute -o 262154 -a 1
         This attribute is defined as a boolean value.
          Enter the boolean attribute value (0 or 1):1

        Cfm3SetAttribute returned: 0x00 : HSM Return: SUCCESS

        Cluster Error Status
        Node id 1 and err state 0x00000000 : HSM Return: SUCCESS
        Node id 0 and err state 0x00000000 : HSM Return: SUCCESS
```

이 명령은 키 `262154`가 이제 영구 키임을 확인하기 위해 **findKey**를 사용하여 세션 키(`-sess 1`)와 영구 키(`-sess 0`)를 찾습니다. 이번에는 이 명령이 세션 키를 찾지 못하지만 영구 키 목록에서 `262154`를 반환합니다.

```
Command: findKey -sess 1

Total number of keys present 0

        Cluster Error Status
        Node id 1 and err state 0x00000000 : HSM Return: SUCCESS
        Node id 0 and err state 0x00000000 : HSM Return: SUCCESS

        Cfm3FindKey returned: 0x00 : HSM Return: SUCCESS



Command: findKey -sess 0

Total number of keys present 5

 number of keys matched from start index 0::4
6, 7, 524296, 9, 262154

        Cluster Error Status
        Node id 1 and err state 0x00000000 : HSM Return: SUCCESS
        Node id 0 and err state 0x00000000 : HSM Return: SUCCESS

        Cfm3FindKey returned: 0x00 : HSM Return: SUCCESS
```

## 파라미터
<a name="setAttribute-parameters"></a>

**-h**  
명령에 대한 도움말을 표시합니다.  
필수 항목 여부: 예

**-o**  
대상 키의 키 핸들을 지정합니다. 각 명령에서 키를 하나만 지정할 수 있습니다. 키의 키 핸들을 가져오려면 [findKey](key_mgmt_util-findKey.md)를 사용합니다.  
필수 항목 여부: 예

**-a**  
변경하려는 속성을 나타내는 상수를 지정합니다. 유일한 유효 값은 `1`로서 토큰 속성 `OBJ_ATTR_TOKEN`을 나타냅니다.  
속성과 해당 정수 값을 가져오려면 [listAttributes](key_mgmt_util-listAttributes.md)를 사용합니다.  
필수: 예

## 관련 주제
<a name="setAttribute-seealso"></a>
+ cloudhsm\_mgmt\_util [setAttribute](cloudhsm_mgmt_util-setAttribute.md)
+ [getAttribute](key_mgmt_util-getAttribute.md)
+ [listAttributes](key_mgmt_util-listAttributes.md)
+ [키 속성 참조](key-attribute-table.md)