openssl_csr_sign

Supported Versions: PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8
Sign a CSR with another certificate (or itself) and generate a certificate
<?php openssl_csr_sign(    OpenSSLCertificateSigningRequest|string $csr,    OpenSSLCertificate|string|null $ca_certificate,    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key,    int $days,    ?array $options = null,    int $serial = 0): OpenSSLCertificate|false
<?php $privkey = openssl_pkey_new();

$cert = openssl_csr_new($dn, $privkey);

$cert = openssl_csr_sign($cert, null, $privkey, 3650);




openssl_x509_export($cert, $out);