Skip to content

Commit

Permalink
Update and add Cloud KMS samples [(#3690)](#3690)
Browse files Browse the repository at this point in the history
This updates the Cloud KMS samples to match the format from the other 6
languages. It also updates the samples to note the workaround for
googleapis/gapic-generator-python#364.
  • Loading branch information
sethvargo authored and rsamborski committed Nov 14, 2022
1 parent c6a6f28 commit 6360704
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
74 changes: 74 additions & 0 deletions kms/attestations/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. This file is automatically generated. Do not edit this file directly.
Google Cloud Key Management Service Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/attestations/README.rst


This directory contains samples for Google Cloud Key Management Service. The `Cloud Key Management Service`_ allows you to create, import, and manage cryptographic keys and perform cryptographic operations in a single centralized cloud service.




.. _Google Cloud Key Management Service: https://cloud.google.com/kms/docs/

Setup
-------------------------------------------------------------------------------


Install Dependencies
++++++++++++++++++++

#. Clone python-docs-samples and change directory to the sample directory you want to use.

.. code-block:: bash
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup

#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

.. code-block:: bash
$ virtualenv env
$ source env/bin/activate
#. Install the dependencies needed to run the samples.

.. code-block:: bash
$ pip install -r requirements.txt
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/

Samples
-------------------------------------------------------------------------------

Verify attestations for keys generated by Cloud HSM
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=kms/attestations/verify_attestation.py,kms/attestations/README.rst




To run this sample:

.. code-block:: bash
$ python verify_attestation.py
.. _Google Cloud SDK: https://cloud.google.com/sdk/
2 changes: 1 addition & 1 deletion kms/attestations/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest==5.3.2
pytest==5.4.1

0 comments on commit 6360704

Please sign in to comment.