Skip to content

[X509Utils] generateSelfSignedCertificate: notBefore, days & notAfter #117

@jimmyff

Description

@jimmyff

I find it very inconsistent to have a notBefore parameter but not a notAfter and then the true notAfter is calculated from the clumsy integer days parameter.

With the current parameters there is no way to have a validity from right now (the time the cert was created) to a clean future date such as: 2026-01-01 00:00:00.

I suggest either removing the 'days' parameter entirely and just having a notAfter parameter. I think this is the best and cleanest solution but it would be a breaking change.

Alternatively you could offer both and adding an assert if both are specified?

If you want to go ahead I'm more than happy to implement and send a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions