5.11. Certificate Lifetime

The certificate lifetime refers to the duration for which a certificate is valid. You can view and modify this duration through the /api/pki/lifetime/1/ endpoint.

5.11.1. Viewing the Certificate Lifetime

To view the current certificate lifetime, you can send a GET request to the /api/pki/lifetime/1/ endpoint. This will return a JSON response with the current lifetime in days.

{
  "days": 2147483647,
  "updated_at": "2024-04-12T09:19:43.732Z",
  "updated_by": 0
}

5.11.2. Modifying the Certificate Lifetime

To modify the certificate lifetime, you can send a PATCH request to the /api/pki/lifetime/1/ endpoint. The request body should be a JSON object with a days field specifying the new lifetime in days.

Please note that only administrators and users with the filebrowser.change_certificatelifetime permission can modify the certificate lifetime.

Example:

curl -X PATCH -H "Content-Type: application/json" -d '{"days": 365}' https://your-domain.com/api/pki/lifetime/1/

In this example, we are setting the certificate lifetime to 365 days.

Remember to replace the days value with the desired lifetime in days.

5.11.3. Summary

The /api/pki/lifetime/1/ endpoint allows you to view and modify the certificate lifetime. Remember that to use the changed lifetime in the certificates, then Ngenea Hub needs to be restarted.