This the wrong way to do this. You will have to wait until I return, however if you want to get started here is the way to go:
- Define SignatureFactoriesManager interface that has get/setSignatureFactories factories methods - Remove the definitions of these methods from their current interface and make that interface extend the new one. - Define UserAuthPubkeyFactory and its created UserAuthPublicKey instances as implementing this interface (both client and server side) - Overwrite each factory's create function to set the created UserAuthPublicKey's signature factories with its own. - Overwrite the default factory instance setter to throw UnsupportedOperationException if invoked - In each UserAuthPublicKey (client or server) instance use a resolveSignatureFactoried method that checks if the set ones are not null/empty.. If null or empty the use the session's factories - Write a unit test - e.g. in the ServerTest class that demonstrates this capability. There are a lot more details, so if you cannot figure them out your pull request will not do the necessary job.