FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

KMS: add asymmetric keys samples by daniel-sanche · Pull Request #1638 · GoogleCloudPlatform/python-docs-samples · GitHub

KMS: add asymmetric keys samples - #1638

Merged
daniel-sanche merged 1 commit into
GoogleCloudPlatform:masterfrom
daniel-sanche:kms-asymmetric
Aug 17, 2018
Merged

KMS: add asymmetric keys samples#1638
daniel-sanche merged 1 commit into
GoogleCloudPlatform:masterfrom
daniel-sanche:kms-asymmetric

Conversation

Copy link
Copy Markdown
Member

Added samples for the KMS Asymmetric Keys launch

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 16, 2018
engelke self-assigned this Aug 16, 2018

engelke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minor point: hanging indents ending on lines 110 and 133 of asymmetric.py have closing paren on lines by themselves. Also, closing braces in lines 34 through 38 of asymmetric_test.py not completely consistent, though all are perfectly clear. Other hanging indents have them at the end of the last line.

LGTM

engelke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

daniel-sanche merged commit 4831bba into GoogleCloudPlatform:master Aug 17, 2018
def signAsymmetric(message, client, key_path):
"""Create a signature for a message using a private key stored on Cloud KMS
"""
digest_bytes = hashlib.sha256(message.encode('ascii')).digest()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This actually varies based on the key algorithm. For EC P-384 keys, it needs to be SHA-384.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do you think leaving a comment explaining this above this line would be sufficient?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yep!-- or something similar to what you did in the Golang lib, where the sample method was obviously limited to a particular key+digest combo.

s2 = create_key_helper(t.rsaSignId, t.rsaSign, 'ASYMMETRIC_SIGN',
'RSA_SIGN_PSS_2048_SHA256', t)
s3 = create_key_helper(t.ecSignId, t.ecSign, 'ASYMMETRIC_SIGN',
'EC_SIGN_P224_SHA256', t)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

P224 was dropped from the API

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL