use of com.quorum.tessera.config.keys.KeyEncryptorFactory in project tessera by ConsenSys.
the class KeyUpdateCommandFactory method create.
@Override
public <K> K create(Class<K> cls) throws Exception {
try {
if (cls != KeyUpdateCommand.class) {
throw new RuntimeException(this.getClass().getSimpleName() + " cannot create instance of type " + cls.getSimpleName());
}
KeyEncryptorFactory keyEncryptorFactory = KeyEncryptorFactory.newFactory();
PasswordReader passwordReader = PasswordReaderFactory.create();
return (K) new KeyUpdateCommand(keyEncryptorFactory, passwordReader);
} catch (Exception e) {
// fallback if missing
return CommandLine.defaultFactory().create(cls);
}
}
Aggregations