Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expiry time when UseX509Certificate is set to true #1571

Open
AndersAbel opened this issue Jun 4, 2024 · 3 comments
Open

Expiry time when UseX509Certificate is set to true #1571

AndersAbel opened this issue Jun 4, 2024 · 3 comments
Labels
bug report Bug report from a user

Comments

@AndersAbel
Copy link
Member

When we create an X509Certificate2 to wrap our keys when UseX509Certificate is set to true, we use the configured expiry lifetime of the keys as the certificate's expiry time.

If the key lifetime (rotation interval) is then increased that will let the current keys live for longer. However, the expiry time captured in the certificate will now not be honoured. We will continue to the use the key beyond that time, which is confusing.

The JWK spec does not mention the expiry time. It does however state that

If other members are present, the contents of those members MUST be
semantically consistent with the related fields in the first
certificate.

If all information in the certificate should be consistent with they key data and usage, then we should not continue using a certificate beyond it's lifetime. Updating the certificate when the lifetime changes is non-trivial; the certificates would not be the same and that could cause issues with key lookup.

This is an edge case, but the right thing to do would probably be to take the X5C expiry time into consideration when deciding when to create a new key.

@brockallen
Copy link
Member

I don't know if I agree. For example, DP keys can use an X509 cert and the expiration time there is never inspected (or honored).

Perhaps we should not set an expiration at all (if that's even possible)?

@brockallen brockallen modified the milestone: Future Sep 17, 2024
@AndersAbel
Copy link
Member Author

DP keys are never exposed in a discovery/metadata doc so they can just decide that they will internally ignore the expiry time. For us, the certificate becomes part of the public contract/communication.

As far as I can tell the not before and not after values are mandatory to supply.

@brockallen
Copy link
Member

But once the cert is created (w/ an expiration), then you can't change it, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report from a user
Projects
None yet
Development

No branches or pull requests

2 participants