public function extract(): string
    {
        $version = $this->getVersion();
        if ('3.2' === $version) {
            $attr = 'certificado';
        } elseif ('3.3' === $version) {
            $attr = 'Certificado';
        } else {
            throw new \RuntimeException('Unsupported or unknown version');
        }
        $certificateBase64 = $this->comprobante->searchAttribute($attr);
        if ('' === $certificateBase64) {
            return '';
        }

        $certificateBin = (string) base64_decode($certificateBase64, true);
        if ('' === $certificateBin) {
            throw new \RuntimeException('The certificado attribute is not a valid base64 encoded string');
        }

        return $certificateBin;
    }