From 804e44a627f8e908e8ed661c05a415fc9caeb02b Mon Sep 17 00:00:00 2001 From: Benson Kuang <3453547+bkuang@users.noreply.github.com> Date: Wed, 3 Nov 2021 18:51:29 -0400 Subject: [PATCH] chore: update README and fix typos in attestation scripts (#203) Remove the README.rst.in until the README gen templates have been updated Co-authored-by: Benson Kuang --- kms/attestations/README.rst | 15 +++++++++------ kms/attestations/README.rst.in | 23 ----------------------- kms/attestations/verify_attestation.py | 2 +- 3 files changed, 10 insertions(+), 30 deletions(-) delete mode 100644 kms/attestations/README.rst.in diff --git a/kms/attestations/README.rst b/kms/attestations/README.rst index 4a9ff7f74d72..de84a1537b37 100644 --- a/kms/attestations/README.rst +++ b/kms/attestations/README.rst @@ -1,5 +1,3 @@ -.. This file is automatically generated. Do not edit this file directly. - Google Cloud Key Management Service Python Samples =============================================================================== @@ -12,7 +10,7 @@ This directory contains samples for Google Cloud Key Management Service. The `Cl -.. _Google Cloud Key Management Service: https://cloud.google.com/kms/docs/ +.. _Cloud Key Management Service: https://cloud.google.com/kms/docs/ @@ -25,11 +23,11 @@ Setup Install Dependencies ++++++++++++++++++++ -#. Clone python-docs-samples and change directory to the sample directory you want to use. +#. Clone python-kms and change directory to the sample directory you want to use. .. code-block:: bash - $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + $ git clone https://github.com/googleapis/python-kms.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. @@ -43,6 +41,11 @@ Install Dependencies $ 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/ @@ -86,7 +89,7 @@ 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=samples/attestations/verify_attestation.py,samples/attestations/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/python-kms&page=editor&open_in_editor=samples/attestations/verify_attestation.py,samples/attestations/README.rst diff --git a/kms/attestations/README.rst.in b/kms/attestations/README.rst.in deleted file mode 100644 index 596ab5fe5b75..000000000000 --- a/kms/attestations/README.rst.in +++ /dev/null @@ -1,23 +0,0 @@ -# This file is used to generate README.rst - -product: - name: Google Cloud Key Management Service - short_name: Cloud Key Management Service - url: https://cloud.google.com/kms/docs/ - description: > - The `Cloud Key Management Service`_ allows you to create, import, and manage - cryptographic keys and perform cryptographic operations in a single centralized cloud service. - -setup: -- install_deps - -samples: -- name: Verify attestations and certificate chains for keys generated by Cloud HSM - file: verify_attestation_chains.py - show_help: True -- name: Verify attestations for keys generated by Cloud HSM - file: verify_attestation.py - show_help: True - -folder: samples/attestations - diff --git a/kms/attestations/verify_attestation.py b/kms/attestations/verify_attestation.py index e534ad9eecb4..090f6b81874e 100644 --- a/kms/attestations/verify_attestation.py +++ b/kms/attestations/verify_attestation.py @@ -56,7 +56,7 @@ def verify(attestation_file, bundle_file): cert_obj = x509.load_pem_x509_certificate( str(cert).encode('utf-8'), backends.default_backend()) try: - # Check if the data was signed by the private key assosicated + # Check if the data was signed by the private key associated # with the public key in the certificate. The data should have # been signed with PKCS1v15 padding. cert_obj.public_key().verify(