Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed style issues
  • Loading branch information
daniel-sanche committed Sep 25, 2018
commit 91a4324bbfc2d0b489df511eb0781f31bf7670ee
5 changes: 3 additions & 2 deletions kms/api-client/asymmetric.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.rom googleapiclient import discovery

# [START kms_asymmetric_imports]
import base64
import hashlib

# [START kms_asymmetric_imports]
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import ec, padding, utils
# [END kms_asymmetric_imports]


# [START kms_get_asymmetric_public]
def getAsymmetricPublicKey(client, key_path):
"""
Expand All @@ -47,7 +48,7 @@ def decryptRSA(ciphertext, client, key_path):
Decrypt a given ciphertext using an 'RSA_DECRYPT_OAEP_2048_SHA256' private
key stored on Cloud KMS
"""
request_body={'ciphertext': base64.b64encode(ciphertext).decode()}
request_body = {'ciphertext': base64.b64encode(ciphertext).decode()}
request = client.projects() \
.locations() \
.keyRings() \
Expand Down