listKeys

abstract suspend fun listKeys(input: ListKeysRequest = ListKeysRequest { }): ListKeysResponse

Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.

Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.

Required permissions: kms:ListKeys (IAM policy)

Related operations:

  • CreateKey

  • DescribeKey

  • ListAliases

  • ListResourceTags

Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.

Samples

// The following example lists KMS keys.
val resp = kmsClient.listKeys()