Skip to content

Commit

Permalink
Fix client_info bug, update docstrings. (#6414)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpebot authored and tseaver committed Nov 6, 2018
1 parent 1985e8b commit 3d47b72
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 175 deletions.
74 changes: 34 additions & 40 deletions packages/google-cloud-kms/google/cloud/kms_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

class ProtectionLevel(enum.IntEnum):
"""
``ProtectionLevel`` specifies how cryptographic operations are performed.
``ProtectionLevel`` specifies how cryptographic operations are
performed.
Attributes:
PROTECTION_LEVEL_UNSPECIFIED (int): Not specified.
Expand All @@ -36,20 +37,17 @@ class CryptoKey(object):
class CryptoKeyPurpose(enum.IntEnum):
"""
``CryptoKeyPurpose`` describes the cryptographic capabilities of a
``CryptoKey``. A given key can only be used for the operations allowed by
its purpose.
``CryptoKey``. A given key can only be used for the operations allowed
by its purpose.
Attributes:
CRYPTO_KEY_PURPOSE_UNSPECIFIED (int): Not specified.
ENCRYPT_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with
``Encrypt`` and
ENCRYPT_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with ``Encrypt`` and
``Decrypt``.
ASYMMETRIC_SIGN (int): ``CryptoKeys`` with this purpose may be used with
``AsymmetricSign`` and
``GetPublicKey``.
ASYMMETRIC_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with
``AsymmetricDecrypt`` and
ASYMMETRIC_SIGN (int): ``CryptoKeys`` with this purpose may be used with ``AsymmetricSign`` and
``GetPublicKey``.
ASYMMETRIC_DECRYPT (int): ``CryptoKeys`` with this purpose may be used with ``AsymmetricDecrypt``
and ``GetPublicKey``.
"""
CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0
ENCRYPT_DECRYPT = 1
Expand All @@ -74,36 +72,33 @@ class AttestationFormat(enum.IntEnum):
class CryptoKeyVersion(object):
class CryptoKeyVersionAlgorithm(enum.IntEnum):
"""
The algorithm of the ``CryptoKeyVersion``, indicating what
parameters must be used for each cryptographic operation.
The algorithm of the ``CryptoKeyVersion``, indicating what parameters
must be used for each cryptographic operation.
The
``GOOGLE_SYMMETRIC_ENCRYPTION``
algorithm is usable with ``CryptoKey.purpose``
``ENCRYPT_DECRYPT``.
The ``GOOGLE_SYMMETRIC_ENCRYPTION`` algorithm is usable with
``CryptoKey.purpose`` ``ENCRYPT_DECRYPT``.
Algorithms beginning with \"RSA_SIGN_\" are usable with ``CryptoKey.purpose``
``ASYMMETRIC_SIGN``.
Algorithms beginning with "RSA\_SIGN\_" are usable with
``CryptoKey.purpose`` ``ASYMMETRIC_SIGN``.
The fields in the name after \"RSA_SIGN_\" correspond to the following
The fields in the name after "RSA\_SIGN\_" correspond to the following
parameters: padding algorithm, modulus bit length, and digest algorithm.
For PSS, the salt length used is equal to the length of digest
algorithm. For example,
``RSA_SIGN_PSS_2048_SHA256``
will use PSS with a salt length of 256 bits or 32 bytes.
algorithm. For example, ``RSA_SIGN_PSS_2048_SHA256`` will use PSS with a
salt length of 256 bits or 32 bytes.
Algorithms beginning with \"RSA_DECRYPT_\" are usable with
``CryptoKey.purpose``
``ASYMMETRIC_DECRYPT``.
Algorithms beginning with "RSA\_DECRYPT\_" are usable with
``CryptoKey.purpose`` ``ASYMMETRIC_DECRYPT``.
The fields in the name after \"RSA_DECRYPT_\" correspond to the following
parameters: padding algorithm, modulus bit length, and digest algorithm.
The fields in the name after "RSA\_DECRYPT\_" correspond to the
following parameters: padding algorithm, modulus bit length, and digest
algorithm.
Algorithms beginning with \"EC_SIGN_\" are usable with ``CryptoKey.purpose``
``ASYMMETRIC_SIGN``.
Algorithms beginning with "EC\_SIGN\_" are usable with
``CryptoKey.purpose`` ``ASYMMETRIC_SIGN``.
The fields in the name after \"EC_SIGN_\" correspond to the following
The fields in the name after "EC\_SIGN\_" correspond to the following
parameters: elliptic curve, digest algorithm.
Attributes:
Expand All @@ -112,9 +107,9 @@ class CryptoKeyVersionAlgorithm(enum.IntEnum):
RSA_SIGN_PSS_2048_SHA256 (int): RSASSA-PSS 2048 bit key with a SHA256 digest.
RSA_SIGN_PSS_3072_SHA256 (int): RSASSA-PSS 3072 bit key with a SHA256 digest.
RSA_SIGN_PSS_4096_SHA256 (int): RSASSA-PSS 4096 bit key with a SHA256 digest.
RSA_SIGN_PKCS1_2048_SHA256 (int): RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_3072_SHA256 (int): RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_4096_SHA256 (int): RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_2048_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 2048 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_3072_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 3072 bit key and a SHA256 digest.
RSA_SIGN_PKCS1_4096_SHA256 (int): RSASSA-PKCS1-v1\_5 with a 4096 bit key and a SHA256 digest.
RSA_DECRYPT_OAEP_2048_SHA256 (int): RSAES-OAEP 2048 bit key with a SHA256 digest.
RSA_DECRYPT_OAEP_3072_SHA256 (int): RSAES-OAEP 3072 bit key with a SHA256 digest.
RSA_DECRYPT_OAEP_4096_SHA256 (int): RSAES-OAEP 4096 bit key with a SHA256 digest.
Expand Down Expand Up @@ -150,9 +145,8 @@ class CryptoKeyVersionState(enum.IntEnum):
DESTROYED (int): This version is destroyed, and the key material is no longer stored.
A version may not leave this state once entered.
DESTROY_SCHEDULED (int): This version is scheduled for destruction, and will be destroyed soon.
Call
``RestoreCryptoKeyVersion``
to put it back into the ``DISABLED`` state.
Call ``RestoreCryptoKeyVersion`` to put it back into the ``DISABLED``
state.
"""
CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0
PENDING_GENERATION = 5
Expand All @@ -163,14 +157,14 @@ class CryptoKeyVersionState(enum.IntEnum):

class CryptoKeyVersionView(enum.IntEnum):
"""
A view for ``CryptoKeyVersion``s. Controls the level of detail returned
for ``CryptoKeyVersions`` in
A view for ``CryptoKeyVersion``\ s. Controls the level of detail
returned for ``CryptoKeyVersions`` in
``KeyManagementService.ListCryptoKeyVersions`` and
``KeyManagementService.ListCryptoKeys``.
Attributes:
CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED (int): Default view for each ``CryptoKeyVersion``. Does not include
the ``attestation`` field.
CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED (int): Default view for each ``CryptoKeyVersion``. Does not include the
``attestation`` field.
FULL (int): Provides all fields in each ``CryptoKeyVersion``, including the
``attestation``.
"""
Expand Down
Loading

0 comments on commit 3d47b72

Please sign in to comment.