Skip to content

Commit

Permalink
docs(storage): Update customer-supplied encryption key docs and examp…
Browse files Browse the repository at this point in the history
…les (#7851)
  • Loading branch information
quartzmo committed Oct 2, 2020
1 parent a1842e7 commit 5bde049
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 5bde049

Please sign in to comment.