CertStore: add support for cert chains
clean up code