Key generation in Factory.
ImportKey in KeyFactory.