def upload_encrypted_blob(bucket_name, source_file_name, destination_blob_name, base64_encryption_key):
 storage_client = storage.Client()
 bucket = storage_client.get_bucket(bucket_name)
 encryption_key = base64.b64decode(base64_encryption_key)
 blob = Blob(destination_blob_name, bucket, encryption_key=encryption_key)
 blob.upload_from_filename(source_file_name)
 print 'File {} uploaded to {}.'.format(source_file_name, destination_blob_name)

def upload_encrypted_blob ( bucket_name , source_file_name , destination_blob_name , base64_encryption_key ) : storage_client = storage . Client ( ) bucket = storage_client . get_bucket ( bucket_name ) encryption_key = base64 . b64decode ( base64_encryption_key ) blob = Blob ( destination_blob_name , bucket , encryption_key = encryption_key ) blob . upload_from_filename ( source_file_name ) print 'File {} uploaded to {}.' . format ( source_file_name , destination_blob_name )
uploads a file to a google cloud storage bucket using a custom encryption key .