Check certificate validity based on a list of pinned certificates and/or public keys.