Skip to content

Files

Latest commit

 

History

History

secretmanager

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Google Secret Manager

Open in Cloud Shell

Google Secret Manager provides a secure and convenient tool for storing API keys, passwords, certificates and other sensitive data. These sample Java applications demonstrate how to access the Secret Manager API using the Google Java API Client Libraries.

Prerequisites

Enable the API

You must enable the Secret Manager API for your project in order to use these samples

Set Environment Variables

You must set your project ID in order to run the tests

$ export GOOGLE_CLOUD_PROJECT=<your-project-id-here>

Grant Permissions

You must ensure that the user account or service account you used to authorize your gcloud session has the proper permissions to edit Secret Manager resources for your project. In the Cloud Console under IAM, add the following roles to the project whose service account you're using to test:

  • Secret Manager Admin (roles/secretmanager.admin)
  • Secret Manager Secret Accessor (roles/secretmanager.secretAccessor)

More information can be found in the Secret Manager Docs