Judgment Approved by the court for handing down.

“Powers for retention of relevant communications data subject
to safeguards
(1) The Secretary of State may by notice (a "retention notice")
require a public telecommunications operator to retain relevant
communications data if the Secretary of State considers that the
requirement is necessary and proportionate for one or more of
the purposes falling within paragraphs (a) to (h) of section
22(2) of the Regulation of Investigatory Powers Act 2000
(purposes for which communications data may be obtained).
(2) A retention notice may(a) relate to a particular operator or any description of
operators,
(b) require the retention of all data or any description of
data,
(c) specify the period or periods for which data is to be
retained,
(d) contain other requirements, or restrictions, in relation
to the retention of data,
(e) make different provision for different purposes,
(f) relate to data whether or not in existence at the time of
the giving, or coming into force, of the notice.
(3) The Secretary of State may by regulations make further
provision about the retention of relevant communications data.
(4) Such provision may, in particular, include provision about(a) requirements before giving a retention notice,
(b) the maximum period for which data is to be retained
under a retention notice,
(c) the content, giving, coming into force, review,
variation or revocation of a retention notice,
(d) the integrity, security or protection of, access to, or the
disclosure or destruction of, data retained by virtue of this
section,
(e) the enforcement of, or auditing compliance with,
relevant requirements or restrictions,
(f) a code of practice in relation to relevant requirements
or restrictions or relevant powers,

Davis & Ors v SSHD

Select target paragraph3