code: async function listCryptoKeys(
    projectId = 'your-project-id', // Your GCP projectId
    keyRingId = 'my-key-ring' // Name of the crypto key's key ring
  ) {
    // Import the library and create a client
    const kms = require('@google-cloud/kms');
    const client = new kms.KeyManagementServiceClient();
  
    // The location of the key ring from which to list crypto keys, e.g. "global"
    const locationId = 'global';
  
    const parent = client.keyRingPath(projectId, locationId, keyRingId);
  
    // Creates a new key ring
    const [cryptoKeys] = await client.listCryptoKeys({parent});
    if (cryptoKeys.length) {
      cryptoKeys.forEach(cryptoKey => {
        console.log(`${cryptoKey.name}:`);
        console.log(`  Created: ${new Date(cryptoKey.createTime)}`);
        console.log(`  Purpose: ${cryptoKey.purpose}`);
        console.log(`  Primary: ${cryptoKey.primary.name}`);
        console.log(`    State: ${cryptoKey.primary.state}`);
        console.log(`    Created: ${new Date(cryptoKey.primary.createTime)}`);
      });
    } else {
      console.log('No crypto keys found.');
    }
  }
docs: [START kms_list_cryptokeys]