@Bean
public IKeyFactory keyFactory() {
KeyFactory keyFactory = new KeyFactory();
SecurityConfigBuilder builder = this.securityConfigBuilder();
CipherConfigure config = builder.getCipherConfigure();
if (config.getAlgorithm() != null) {
keyFactory.setAlgorithm(config.getAlgorithm());
}
if (config.getKeySize() > 0) {
keyFactory.setKeySize(config.getKeySize());
}
if (config.getPrngAlgorithm() != null) {
keyFactory.setPrngAlgorithm(config.getPrngAlgorithm());
}
if (config.getProvider() != null) {
keyFactory.setProvider(config.getProvider());
}
return keyFactory;
}