You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: document_writer.rb
    path of file: ./repos/identity-idp/app/services/encrypted_document_storage
    
    the code of the file until where you have to start completion: module EncryptedDocumentStorage
  class DocumentWriter
    def encrypt_and_write_document(
      front_image:,
      front_image_content_type:,
      back_image:,
      back_image_content_type:
    )
      key = SecureRandom.bytes(32)
      encryp
    
    def encrypt_and_write_document(
      front_image:,
      front_image_content_type:,
      back_image:,
      back_image_content_type:
    )
      key = SecureRandom.bytes(32)
      encrypted_front_image = aes_cipher.encrypt(front_image, key)
      encrypted_back_image = aes_cipher.encrypt(back_image, key)

      front_filename = build_filename_for_content_type(front_image_content_type)
      back_filename = build_filename_for_content_type(back_image_content_type)

      storage.write_image(encrypted_image: encrypted_front_image, name: front_filename)
      storage.write_image(encrypted_image: encrypted_back_image, name: back_filename)

      WriteDocumentResult.new(
        front_filename: front_filename,
        back_filename: back_filename,
        encryption_key: Base64.strict_encode64(key),
      )
    end