code: async function uploadEncryptedFile(bucketName, srcFilename, destFilename, key) {
    // [START storage_upload_encrypted_file]
    // Imports the Google Cloud client library
    const {Storage} = require('@google-cloud/storage');
  
    // Creates a client
    const storage = new Storage();
  
    /**
     * TODO(developer): Uncomment the following lines before running the sample.
     */
    // const bucketName = 'Name of a bucket, e.g. my-bucket';
    // const srcFilename = 'Local file to upload, e.g. ./local/path/to/file.txt';
    // const destFilename = 'Remote destination for file, e.g. file_encrypted.txt';
  
    // See the "Generating your own encryption key" section above.
    // const key = 'A base64 encoded customer-supplied key';
  
    const options = {
      // The path to which the file should be uploaded, e.g. "file_encrypted.txt"
      destination: destFilename,
      // Encrypt the file with a customer-supplied key.
      // See the "Generating your own encryption key" section above.
      encryptionKey: Buffer.from(key, 'base64'),
    };
  
    // Encrypts and uploads a local file, e.g. "./local/path/to/file.txt".
    // The file will only be retrievable using the key used to upload it.
    await storage.bucket(bucketName).upload(srcFilename, options);
  
    console.log(
      `File ${srcFilename} uploaded to gs://${bucketName}/${destFilename}.`
    );
    // [END storage_upload_encrypted_file]
  }
docs: [END storage_generate_encryption_key]