public function endEntityCertificate(): Certificate
    {
        if (!count($this->_certificates)) {
            throw new \LogicException("No certificates.");
        }
        return $this->_certificates[count($this->_certificates) - 1];
    }