Yes, that's what it means. In the old days, the British monarch locked enemies up in the Tower of London literally for as long as he liked. Nowadays, it is a set legal term meaning what it says: 'at the discretion of the Minister of Justice' or equivalent justice department in the government of various British Commonwealth nations.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.