Adding a CA for self signed certificates #5

This pull request is linked to the issue #5 
Please could you separate this code in two methods? The `generate_self_signed_cert` method is becoming too big.