Helper functions for certificate chains