99designs / http-signatures-php

Sign and verify PSR-7 HTTP messages in PHP.
MIT License
44 stars 33 forks source link

Key rotation: Verifier should support N keys #18

Open pda opened 9 years ago

pda commented 9 years ago

Copied from https://github.com/99designs/http-signatures-ruby/issues/10


Currently key rotation is difficult; the verifier needs to start verifying with the new key at the same moment the new key is used by the signer. In a high-traffic environment this can be near impossible without dropping requests.

It should be possible to pass multiple keys to the verifier, so that both old and new keys can be accepted for a period of time. Either N keys, or a static limit of two keys (current and previous) would work.

This could be represented by passing an array of keys per ID; using the first for signing, and using all of them for verification. Or… something else?

poisa commented 5 years ago

👍 This feature would be great!