public function sign(CertificateSigningRequest $csr, int $serial = 0): Certificate {
        $certificate = openssl_csr_sign(
            $csr->export(),
            $this->getCertificate(),
            $this->getPrivateKey(),
            $this->getLifetime(),
            $this->getOptions(),
            $serial
        );
        return new Certificate($certificate);
    }