Currently, it's a bug, so there are two solutions:
- use another library - tbuktu's github project (bouncy-castle is using it with some modifications, as I see)
- download sources, catch the bug of this generation parameter, solve it and pack into library for a project