Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 8849ce7

Browse files
authored
Samples migration to python-doc-sample (#362)
Samples migration to python-doc-sample in scope of monorepo migration
1 parent c25a973 commit 8849ce7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+6
-4469
lines changed

samples/attestations/README.rst

Lines changed: 3 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,4 @@
1-
Google Cloud Key Management Service Python Samples
2-
===============================================================================
1+
Samples migrated
2+
================
33

4-
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
5-
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/python-kms&page=editor&open_in_editor=samples/attestations/README.rst
6-
7-
8-
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.
9-
10-
11-
12-
13-
.. _Cloud Key Management Service: https://cloud.google.com/kms/docs/
14-
15-
16-
17-
18-
19-
Setup
20-
-------------------------------------------------------------------------------
21-
22-
23-
Install Dependencies
24-
++++++++++++++++++++
25-
26-
#. Clone python-kms and change directory to the sample directory you want to use.
27-
28-
.. code-block:: bash
29-
30-
$ git clone https://github.com/googleapis/python-kms.git
31-
32-
#. 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.
33-
34-
.. _Python Development Environment Setup Guide:
35-
https://cloud.google.com/python/setup
36-
37-
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
38-
39-
.. code-block:: bash
40-
41-
$ virtualenv env
42-
$ source env/bin/activate
43-
44-
#. Install the dependencies needed to run the samples.
45-
46-
.. code-block:: bash
47-
48-
$ pip install -r requirements.txt
49-
50-
.. _pip: https://pip.pypa.io/
51-
.. _virtualenv: https://virtualenv.pypa.io/
52-
53-
Samples
54-
-------------------------------------------------------------------------------
55-
56-
Verify attestations and certificate chains for keys generated by Cloud HSM
57-
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
58-
59-
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
60-
: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_chains.py,samples/attestations/README.rst
61-
62-
63-
64-
65-
To run this sample:
66-
67-
.. code-block:: bash
68-
69-
$ python verify_attestation_chains.py
70-
71-
usage: verify_attestation_chains.py [-h] [--certificates CERTIFICATES]
72-
[--attestation ATTESTATION]
73-
74-
This application verifies HSM attestations using certificate chains
75-
obtained from Cloud HSM and the HSM manufacturer.
76-
77-
For more information, visit https://cloud.google.com/kms/docs/attest-key.
78-
79-
optional arguments:
80-
-h, --help show this help message and exit
81-
--certificates CERTIFICATES
82-
The certificate chains filename.
83-
--attestation ATTESTATION
84-
The attestation filename.
85-
86-
87-
88-
Verify attestations for keys generated by Cloud HSM
89-
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
90-
91-
.. image:: https://gstatic.com/cloudssh/images/open-btn.png
92-
: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
93-
94-
95-
96-
97-
To run this sample:
98-
99-
.. code-block:: bash
100-
101-
$ python verify_attestation.py
102-
103-
usage: verify_attestation.py [-h] attestation_file bundle_file
104-
105-
This application verifies HSM attestations using certificate bundles obtained
106-
from Cloud HSM. For more information, visit https://cloud.google.com/kms/docs
107-
/attest-key.
108-
109-
positional arguments:
110-
attestation_file Name of attestation file.
111-
bundle_file Name of certificate bundle file.
112-
113-
optional arguments:
114-
-h, --help show this help message and exit
115-
116-
117-
118-
119-
120-
.. _Google Cloud SDK: https://cloud.google.com/sdk/
4+
New location: https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/kms/attestations

0 commit comments

Comments
 (0)