The invention relates to a method, electronic device and computer program
for providing digital rights management. The electronic device comprises
a first clock and an optional second clock. The electronic device may
store at least one protected media object and rights associated with the
media object. A time attack event is detected in the electronic device. A
barring time is increased when a time attack event occurs. The barring
time is decreased regularly. It is checked whether the barring time
exceeds a predefined value at a request to present at least one media
object. The at least one media object is presented if that is allowed by
rights associated with the at least one media object and the barring time
does not exceed the predefined value. The benefits of the invention are
related to improved enforcement of digital rights.