Even if your driving and they want to check if you have a licence?
Well, this can get pretty complicated pretty quickly and takes us away from photographers situations, but...
A Police Officer can 'stop' a vehicle at any time for any reason, but usually they will have had good reason. They can legally ask to see your driving licence, and ask you what you are doing etc, and that will usually be the end of it. If they ask you to step out of the car, and then search it, it's a 'stop AND search'. That being so, the same rules as to a pedestrian stop and search apply. If you were stopped for committing a traffic offence, then this should be made clear and they should tell you that they will be reporting you for whatever offence they suspect you of committing. At this point, you do have to give your name and address, otherwise you will probably be arrested until they can satisfy themselves as to who you are. Basically, you have fewer rights in a vehicle than on foot!
The general principle to remember is that stops and searches do not require you to identify yourself if you don't want to (in England & Wales) although most Police will ask for this information as a matter of course. Most people will give this information freely, and it will usually mean a quicker end result for all concerned and you can then resume whatever business it was you were going about.
Only if you are informed you are being reported for an offence (and they should state what it is) do you HAVE to provide personal information, including any offences that result from a stop and search.
I'm not a lawyer or Police Officer, this information is freely available on most UK Police Websites, it's worth taking a few minutes to get yourself up to speed as to what your rights and responsibilities are.
eg http://www.met.police.uk/stopandsearch/what_is.htm
I would add you should always be polite and courteous (as should the officer) as at the end of the day, most Police/PCSO's are only doing their job and have your best interests at heart.

Last edited: