improve the handling of certificates

Signed-off-by: Lehner Florian <dev@der-flo.net>