tomitribe/http-signatures-java

Improve Signer testability

Closed this issue · 0 comments

Signer.sign(..) method uses System.currentTimeMillis() to get current time. This makes it difficult to test code that relies on Signer.

Replacing System.currentTimeInMillis() with a java.util.Clock millis() and making the Clock a configurable attribute of the Signer class would improve Signer testability by allowing to fix the only variable element of the signature.