0

I want to configure an expiration period of 5 years for a root CA certificate on NetApp ONTAP via its API.

The expiry_time is documented like this:

expiry_time

Certificate expiration time. Can be provided on POST if creating self-signed certificate. The expiration time range is between 1 day to 10 years.

An example for 365 days is P365DT. I am not aware of a format to specify time periods like this. Can someone tell me how this works? How do I specify 5 years in that format?

stackprotector
  • 596
  • 1
  • 8
  • 27

1 Answers1

1

As a cheap workaround, you can of course calculate the number of days for 5 years and just use

P1825DT

as the expiry time period. But there is a name for that format and it also supports years. The format is defined in ISO 8601 and is used to describe durations.

The string always starts with P for period. It can then be followed by Years, Months, Weeks and/or Days. If you also want to specify Hours, Minutes and/or Seconds, append a T for time first and then add the desired values. Example for 5 years:

P5Y

Example for 8 years, 5 months, 20 days, 13 hours and 37 minutes:

P8Y5M20DT13H37M
stackprotector
  • 596
  • 1
  • 8
  • 27