Skip to content

Commit 8ad195a

Browse files
dpebottseaver
authored andcommitted
Fix client_info bug, update docstrings. (#6414)
1 parent 6ca19ce commit 8ad195a

File tree

3 files changed

+151
-175
lines changed

3 files changed

+151
-175
lines changed

kms/google/cloud/kms_v1/gapic/enums.py

Lines changed: 34 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
class ProtectionLevel(enum.IntEnum):
2222
"""
23-
``ProtectionLevel`` specifies how cryptographic operations are performed.
23+
``ProtectionLevel`` specifies how cryptographic operations are
24+
performed.
2425
2526
Attributes:
2627
PROTECTION_LEVEL_UNSPECIFIED (int): Not specified.
@@ -36,20 +37,17 @@ class CryptoKey(object):
3637
class CryptoKeyPurpose(enum.IntEnum):
3738
"""
3839
``CryptoKeyPurpose`` describes the cryptographic capabilities of a
39-
``CryptoKey``. A given key can only be used for the operations allowed by
40-
its purpose.
40+
``CryptoKey``. A given key can only be used for the operations allowed
41+
by its purpose.
4142
4243
Attributes:
4344
CRYPTO_KEY_PURPOSE_UNSPECIFIED (int): Not specified.
44-
ENCRYPT_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with
45-
``Encrypt`` and
45+
ENCRYPT_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with ``Encrypt`` and
4646
``Decrypt``.
47-
ASYMMETRIC_SIGN (int): ``CryptoKeys`` with this purpose may be used with
48-
``AsymmetricSign`` and
49-
``GetPublicKey``.
50-
ASYMMETRIC_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with
51-
``AsymmetricDecrypt`` and
47+
ASYMMETRIC_SIGN (int): ``CryptoKeys`` with this purpose may be used with ``AsymmetricSign`` and
5248
``GetPublicKey``.
49+
ASYMMETRIC_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with ``AsymmetricDecrypt``
50+
and ``GetPublicKey``.
5351
"""
5452
CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0
5553
ENCRYPT_DECRYPT = 1
@@ -74,36 +72,33 @@ class AttestationFormat(enum.IntEnum):
7472
class CryptoKeyVersion(object):
7573
class CryptoKeyVersionAlgorithm(enum.IntEnum):
7674
"""
77-
The algorithm of the ``CryptoKeyVersion``, indicating what
78-
parameters must be used for each cryptographic operation.
75+
The algorithm of the ``CryptoKeyVersion``, indicating what parameters
76+
must be used for each cryptographic operation.
7977
80-
The
81-
``GOOGLE_SYMMETRIC_ENCRYPTION``
82-
algorithm is usable with ``CryptoKey.purpose``
83-
``ENCRYPT_DECRYPT``.
78+
The ``GOOGLE_SYMMETRIC_ENCRYPTION`` algorithm is usable with
79+
``CryptoKey.purpose`` ``ENCRYPT_DECRYPT``.
8480
85-
Algorithms beginning with \"RSA_SIGN_\" are usable with ``CryptoKey.purpose``
86-
``ASYMMETRIC_SIGN``.
81+
Algorithms beginning with "RSA\_SIGN\_" are usable with
82+
``CryptoKey.purpose`` ``ASYMMETRIC_SIGN``.
8783
88-
The fields in the name after \"RSA_SIGN_\" correspond to the following
84+
The fields in the name after "RSA\_SIGN\_" correspond to the following
8985
parameters: padding algorithm, modulus bit length, and digest algorithm.
9086
9187
For PSS, the salt length used is equal to the length of digest
92-
algorithm. For example,
93-
``RSA_SIGN_PSS_2048_SHA256``
94-
will use PSS with a salt length of 256 bits or 32 bytes.
88+
algorithm. For example, ``RSA_SIGN_PSS_2048_SHA256`` will use PSS with a
89+
salt length of 256 bits or 32 bytes.
9590
96-
Algorithms beginning with \"RSA_DECRYPT_\" are usable with
97-
``CryptoKey.purpose``
98-
``ASYMMETRIC_DECRYPT``.
91+
Algorithms beginning with "RSA\_DECRYPT\_" are usable with
92+
``CryptoKey.purpose`` ``ASYMMETRIC_DECRYPT``.
9993
100-
The fields in the name after \"RSA_DECRYPT_\" correspond to the following
101-
parameters: padding algorithm, modulus bit length, and digest algorithm.
94+
The fields in the name after "RSA\_DECRYPT\_" correspond to the
95+
following parameters: padding algorithm, modulus bit length, and digest
96+
algorithm.
10297
103-
Algorithms beginning with \"EC_SIGN_\" are usable with ``CryptoKey.purpose``
104-
``ASYMMETRIC_SIGN``.
98+
Algorithms beginning with "EC\_SIGN\_" are usable with
99+
``CryptoKey.purpose`` ``ASYMMETRIC_SIGN``.
105100
106-
The fields in the name after \"EC_SIGN_\" correspond to the following
101+
The fields in the name after "EC\_SIGN\_" correspond to the following
107102
parameters: elliptic curve, digest algorithm.
108103
109104
Attributes:
@@ -112,9 +107,9 @@ class CryptoKeyVersionAlgorithm(enum.IntEnum):
112107
RSA_SIGN_PSS_2048_SHA256 (int): RSASSA-PSS 2048 bit key with a SHA256 digest.
113108
RSA_SIGN_PSS_3072_SHA256 (int): RSASSA-PSS 3072 bit key with a SHA256 digest.
114109
RSA_SIGN_PSS_4096_SHA256 (int): RSASSA-PSS 4096 bit key with a SHA256 digest.
115-
RSA_SIGN_PKCS1_2048_SHA256 (int): RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
116-
RSA_SIGN_PKCS1_3072_SHA256 (int): RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
117-
RSA_SIGN_PKCS1_4096_SHA256 (int): RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
110+
RSA_SIGN_PKCS1_2048_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 2048 bit key and a SHA256 digest.
111+
RSA_SIGN_PKCS1_3072_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 3072 bit key and a SHA256 digest.
112+
RSA_SIGN_PKCS1_4096_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 4096 bit key and a SHA256 digest.
118113
RSA_DECRYPT_OAEP_2048_SHA256 (int): RSAES-OAEP 2048 bit key with a SHA256 digest.
119114
RSA_DECRYPT_OAEP_3072_SHA256 (int): RSAES-OAEP 3072 bit key with a SHA256 digest.
120115
RSA_DECRYPT_OAEP_4096_SHA256 (int): RSAES-OAEP 4096 bit key with a SHA256 digest.
@@ -150,9 +145,8 @@ class CryptoKeyVersionState(enum.IntEnum):
150145
DESTROYED (int): This version is destroyed, and the key material is no longer stored.
151146
A version may not leave this state once entered.
152147
DESTROY_SCHEDULED (int): This version is scheduled for destruction, and will be destroyed soon.
153-
Call
154-
``RestoreCryptoKeyVersion``
155-
to put it back into the ``DISABLED`` state.
148+
Call ``RestoreCryptoKeyVersion`` to put it back into the ``DISABLED``
149+
state.
156150
"""
157151
CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0
158152
PENDING_GENERATION = 5
@@ -163,14 +157,14 @@ class CryptoKeyVersionState(enum.IntEnum):
163157

164158
class CryptoKeyVersionView(enum.IntEnum):
165159
"""
166-
A view for ``CryptoKeyVersion``s. Controls the level of detail returned
167-
for ``CryptoKeyVersions`` in
160+
A view for ``CryptoKeyVersion``\ s. Controls the level of detail
161+
returned for ``CryptoKeyVersions`` in
168162
``KeyManagementService.ListCryptoKeyVersions`` and
169163
``KeyManagementService.ListCryptoKeys``.
170164
171165
Attributes:
172-
CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED (int): Default view for each ``CryptoKeyVersion``. Does not include
173-
the ``attestation`` field.
166+
CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED (int): Default view for each ``CryptoKeyVersion``. Does not include the
167+
``attestation`` field.
174168
FULL (int): Provides all fields in each ``CryptoKeyVersion``, including the
175169
``attestation``.
176170
"""

0 commit comments

Comments
 (0)