These samples show how to use the Google Cloud KMS API from PHP.
-
Enable APIs - Enable the KMS API and create a new project or select an existing project.
-
Activate your Credentials - If you do not already have an active set of credentials, create and download a JSON Service Account key. Set the environment variable
GOOGLE_APPLICATION_CREDENTIALSas the path to the downloaded JSON file. -
Clone the repo and cd into this directory
$ git clone https://github.com/GoogleCloudPlatform/php-docs-samples $ cd php-docs-samples/kms -
Install dependencies via Composer. Run
php composer.phar install(if composer is installed locally) orcomposer install(if composer is installed globally). -
Run
php src/SNIPPET_NAME.php. The usage will print for each if no arguments are provided:$ php src/create_dataset.php Usage: php src/list_keyrings.php PROJECT_ID LOCATION $ php src/list_keyrings.php your-project-id us-west1 Name: projects/your-project-id/locations/us-west1/keyRings/your-test-keyring Create Time: 2018-12-28 06:27:56
- See CONTRIBUTING.md
- See LICENSE