lib/TokenFactory.php
private function prepareKeyPair(KeyPairReference $keyPair = null)
	{

		if (!isset($keyPair)) {
			if (!static::isReady()) {
				throw new NotReadyException("Default key pair provider has not been set");
			}
			$keyPair = $this->defaultKeyPair;
		}
		return $keyPair;
	}
private function prepareKeyPair(KeyPairReference $keyPair = null)
	{

		if (!isset($keyPair)) {
			if (!static::isReady()) {
				throw new NotReadyException("Default key pair provider has not been set");
			}
			$keyPair = $this->defaultKeyPair;
		}
		return $keyPair;
	}
Prepares the $keyPair object

@param  KeyPairReference|null $keyPair Key pair to use with encrypting token (optional)
@return KeyPairReference Key pair to use