You can define the time period when a key is active.
device# configure terminal
device(config)# keychain keychain1
device(config-keychain1)# key 10
device(config-keychain1-key10)# accept-lifetime 00:00:00|06/04/2020 23:59:59|12/04/2020
This example configures a lifetime from June 6 2020 to December 4 2020 (local) for key 10 in key chain 1.
device# configure terminal device(config)# keychain keychain1 device(config-keychain1)# key 10 device(config-keychain1-key10)# accept-lifetime local true 00:00:00|06/04/2020 23:59:59|12/04/2020
This example configures a lifetime that never expires for key 10 in key chain 1.
device# configure terminal device(config)# keychain keychain1 device(config-keychain1)# key 10 device(config-keychain1-key10)# accept-lifetime infinite