def LUKSDEUnlockVolume(luksde_volume, path_spec, key_chain):
  """Unlocks a LUKSDE volume using the path specification.

  Args:
    luksde_volume (pyluksde.volume): LUKSDE volume.
    path_spec (PathSpec): path specification.
    key_chain (KeyChain): key chain.

  Returns:
    bool: True if the volume is unlocked, False otherwise.
  """
  is_locked = luksde_volume.is_locked()
  if is_locked:
    password = key_chain.GetCredential(path_spec, 'password')
    if password:
      luksde_volume.set_password(password)

    is_locked = not luksde_volume.unlock()

  return not is_locked