Updated to support per entity cert and key.