This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Did you create these two methods? You've left out the bodies of these classes, so I can't check. I do know that they don't inherit these methods from KeyGeneratorSpi, so you will need to implement them.
Edit: I found the getInstance method inside class KeyGenerator, but that class has no direct relationship with KeyGeneratorSpi. As for a method called initialize that takes a KeyGenerator, there is none in the API.