code: def get_cert_contents(kwargs):
      
      paths = {
          "certificate": kwargs.get("path_to_certificate"),
          "private_key": kwargs.get("path_to_private_key"),
          "chain": kwargs.get("path_to_chain"),
      }
  
      for key, value in paths.items():
          if value is not None:
              continue
  
          path = input("Path to %s (skip): " % (key,))
          if path == "skip" or not path.strip():
              continue
  
          paths[key] = path
  
      parameters = {
          "ServerCertificateName": kwargs.get("cert_name"),
      }
  
      for key, path in paths.items():
          if not path:
              continue
  
          # Allow passing of file like object for tests
          try:
              contents = path.read()
          except AttributeError:
              with open(utils.full_path(path)) as read_file:
                  contents = read_file.read()
  
          if key == "certificate":
              parameters["CertificateBody"] = contents
          elif key == "private_key":
              parameters["PrivateKey"] = contents
          elif key == "chain":
              parameters["CertificateChain"] = contents
  
      return parameters
docs: Builds parameters with server cert file contents.
  
      Args:
          kwargs(dict): The keyword args passed to ensure_server_cert_exists,
              optionally containing the paths to the cert, key and chain files.
  
      Returns:
          dict: A dictionary containing the appropriate parameters to supply to
              upload_server_certificate. An empty dictionary if there is a
              problem.