키 목록 - AWS CloudHSM

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

키 목록

key list 명령은 AWS CloudHSM 클러스터에 있는 현재 사용자의 모든 키를 찾습니다. 출력에는 사용자가 소유 및 공유하는 키는 물론 CloudHSM 클러스터의 모든 퍼블릭 키가 포함됩니다.

사용자 유형

다음 사용자 유형이 이 명령을 실행할 수 있습니다.

  • CU(Crypto User)

구문

aws-cloudhsm > help key list List the keys the current user owns, shares, and all public keys in the HSM cluster Usage: key list [OPTIONS] Options: --cluster-id <CLUSTER_ID> Unique Id to choose which of the clusters in the config file to run the operation against. If not provided, will fall back to the value provided when interactive mode was started, or error --filter [<FILTER>...] Key reference (e.g. key-reference=0xabc) or space separated list of key attributes in the form of attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE to select matching key(s) to list --max-items <MAX_ITEMS> The total number of items to return in the command's output. If the total number of items available is more than the value specified, a next-token is provided in the command's output. To resume pagination, provide the next-token value in the starting-token argument of a subsequent command [default: 10] --starting-token <STARTING_TOKEN> A token to specify where to start paginating. This is the next-token from a previously truncated response -v, --verbose If included, prints all attributes and key information for each matched key. By default each matched key only displays its key-reference and label attribute -h, --help Print help

예제

다음 예에서는 key list 명령을 실행하는 다양한 방법을 보여줍니다.

예: 모든 키 찾기 - 기본값

이 명령은 AWS CloudHSM 클러스터에 있는 로그인한 사용자의 키를 나열합니다.

참고

기본적으로 현재 로그인한 사용자의 키 10개만 표시되고 key-referencelabel만 출력으로 표시됩니다. 적절한 페이지 매김 옵션을 사용하여 출력으로 더 많거나 적은 키를 표시할 수 있습니다.

aws-cloudhsm > key list { "error_code": 0, "data": { "matched_keys": [ { "key-reference": "0x00000000000003d5", "attributes": { "label": "test_label_1" } }, { "key-reference": "0x0000000000000626", "attributes": { "label": "test_label_2" } },. ...8 keys later... ], "total_key_count": 56, "returned_key_count": 10, "next_token": "10" } }
예: 모든 키 찾기 - verbose

출력에는 사용자가 소유 및 공유하는 키는 물론 HSM의 모든 퍼블릭 키가 포함됩니다.

참고

참고: 기본적으로 현재 로그인한 사용자의 키 10개만 표시됩니다. 적절한 페이지 매김 옵션을 사용하여 출력으로 더 많거나 적은 키를 표시할 수 있습니다.

aws-cloudhsm > key list --verbose { "error_code": 0, "data": { "matched_keys": [ { "key-reference": "0x000000000012000c", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "session" }, "attributes": { "key-type": "ec", "label": "ec-test-private-key", "id": "", "check-value": "0x2a737d", "class": "private-key", "encrypt": false, "decrypt": false, "token": false, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": false, "trusted": false, "unwrap": false, "verify": false, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 122, "ec-point": "0x0442d53274a6c0ec1a23c165dcb9ccdd72c64e98ae1a9594bb5284e752c746280667e11f1e983493c1c605e0a8071ede47ca280f94c6b2aa33", "curve": "secp224r1" } }, { "key-reference": "0x000000000012000d", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "session" }, "attributes": { "key-type": "ec", "label": "ec-test-public-key", "id": "", "check-value": "0x2a737d", "class": "public-key", "encrypt": false, "decrypt": false, "token": false, "always-sensitive": false, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": false, "sign": false, "trusted": false, "unwrap": false, "verify": false, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 57, "ec-point": "0x0442d53274a6c0ec1a23c165dcb9ccdd72c64e98ae1a9594bb5284e752c746280667e11f1e983493c1c605e0a8071ede47ca280f94c6b2aa33", "curve": "secp224r1" } } ], ...8 keys later... "total_key_count": 1580, "returned_key_count": 10 } }
예: 페이지를 매긴 반환

다음 예에서는 두 개의 키만 표시하는 페이지가 매겨진 키 하위 집합을 표시합니다. 그런 다음 예제에서는 다음 두 키를 표시하기 위한 후속 호출을 제공합니다.

aws-cloudhsm > key list --verbose --max-items 2 { "error_code": 0, "data": { "matched_keys": [ { "key-reference": "0x0000000000000030", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "98a6688d1d964ed7b45b9cec5c4b1909", "id": "", "check-value": "0xb28a46", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 32 } }, { "key-reference": "0x0000000000000042", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "4ad6cdcbc02044e09fa954143efde233", "id": "", "check-value": "0xc98104", "class": "secret-key", "encrypt": true, "decrypt": true, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": true, "verify": true, "wrap": true, "wrap-with-trusted": false, "key-length-bytes": 16 } } ], "total_key_count": 1580, "returned_key_count": 2, "next_token": "2" } }

다음 두 키를 표시하려면 후속 호출을 수행하면 됩니다.

aws-cloudhsm > key list --verbose --max-items 2 --starting-token 2 { "error_code": 0, "data": { "matched_keys": [ { "key-reference": "0x0000000000000081", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "6793b8439d044046982e5b895791e47f", "id": "", "check-value": "0x3f986f", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 32 } }, { "key-reference": "0x0000000000000089", "key-info": { "key-owners": [ { "username": "cu1", "key-coverage": "full" } ], "shared-users": [], "cluster-coverage": "full" }, "attributes": { "key-type": "aes", "label": "56b30fa05c6741faab8f606d3b7fe105", "id": "", "check-value": "0xe9201a", "class": "secret-key", "encrypt": false, "decrypt": false, "token": true, "always-sensitive": true, "derive": false, "destroyable": true, "extractable": true, "local": true, "modifiable": true, "never-extractable": false, "private": true, "sensitive": true, "sign": true, "trusted": false, "unwrap": false, "verify": true, "wrap": false, "wrap-with-trusted": false, "key-length-bytes": 32 } } ], "total_key_count": 1580, "returned_key_count": 2, "next_token": "4" } }

CloudHSM CLI에서 키 필터링 메커니즘이 작동하는 방식을 보여주는 추가 예제는 CloudHSM CLI를 사용하여 키를 필터링을 참조하십시오.

인수

<CLUSTER_ID>

이 작업을 실행할 클러스터의 ID입니다.

필수: 여러 클러스터가 구성된 경우

<FILTER>

일치하는 키를 attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE 나열하기 위한 형식의 키 참조 (예:key-reference=0xabc) 또는 공백으로 구분된 키 속성 목록

지원되는 CloudHSM CLI 키 속성 목록은 CloudHSM CLI의 키 속성 섹션을 참조하십시오.

필수 여부: 아니요

<MAX_ITEMS>

명령의 출력에서 반환되는 항목의 총 수입니다. 사용 가능한 총 항목 수가 지정된 값을 초과하는 경우 명령의 출력에 다음 토큰이 제공됩니다. 페이지 매김을 재개하려면 후속 명령의 시작 토큰에 다음 토큰 값을 제공합니다.

필수 여부: 아니요

<STARTING_TOKEN>

페이지 매김을 시작할 위치를 지정하기 위한 토큰입니다. 이는 이전에 잘린 응답의 다음 토큰입니다.

필수 여부: 아니요

<VERBOSE>

포함된 경우 일치하는 각 키의 모든 속성 및 키 정보를 인쇄합니다. 기본적으로 일치하는 각 키는 해당 키 참조 및 레이블 속성만 표시합니다.

필수 여부: 아니요

관련 주제