use KeyStoreInterface as  clean way for people to implement their own KeyStore

Could you:

* assign `$keyStore = $args['keyStore']` at the top of the `elseif` to avoid looking it up three times from the associative array,
* delete the comment, as the new type check makes it redundant,
* consider passing `$keyStore` to a new `private function setKeyStore(KeyStoreInterface $keyStore)` method so that you don't need to do the manual type checking.