First of all, the messages mentioned are not errors. They are warnings. Your program will run fine, but the methods or classes you use are marked as deprecated. That means you can still use them, but it is not recommended to do so, because in future versions of bouncy castle, these methods or classes might be removed.
Go to an up to date API documentation of these classes. There should be information what to use instead of the deprecated methods/classes.