Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(storage): Update customer-supplied encryption key docs and examples #7851

Merged
merged 1 commit into from Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions google-cloud-storage/lib/google/cloud/storage/file.rb
Expand Up @@ -412,7 +412,8 @@ def metadata= metadata
# You can use this SHA256 hash to uniquely identify the AES-256
# encryption key required to decrypt this file.
#
# @return [String]
# @return [String, nil] The encoded SHA256 hash, or `nil` if there is
# no customer-supplied encryption key for this file.
#
def encryption_key_sha256
return nil unless @gapi.customer_encryption
Expand Down Expand Up @@ -1229,7 +1230,7 @@ def copy dest_bucket_or_path, dest_path = nil, acl: nil, generation: nil, encryp
# cipher.encrypt
# new_key = cipher.random_key
#
# file = bucket.file "path/to/my-file.ext"
# file = bucket.file "path/to/my-file.ext", encryption_key: old_key
# file.rewrite "new-destination-bucket",
# "path/to/destination/file.ext",
# encryption_key: old_key,
Expand All @@ -1250,7 +1251,7 @@ def copy dest_bucket_or_path, dest_path = nil, acl: nil, generation: nil, encryp
# # Old customer-supplied key was stored securely for later use.
# old_key = "y\x03\"\x0E\xB6\xD3\x9B\x0E\xAB*\x19\xFAv\xDEY\xBEI..."
#
# file = bucket.file "path/to/my-file.ext"
# file = bucket.file "path/to/my-file.ext", encryption_key: old_key
# file.rewrite "new-destination-bucket",
# "path/to/destination/file.ext",
# encryption_key: old_key,
Expand Down