method generateCertFiles documentation in bbn\Util\Enc
Generates a private and a public SSL certificate files.
function(string $path, string $algo = 'sha512', int $key_bits = 4096)
{
$res = false;
if (is_dir(X::dirname($path))
&& !file_exists($path.'_rsa')
&& in_array($algo, hash_algos(), true)
&& ($key = self::generateCert($algo, $key_bits))
) {
if (is_dir($path) && (substr($path, -1) !== '/')) {
$path .= '/';
}
$public = $path.'_rsa.pub';
$private = $path.'_rsa';
if (\file_put_contents($public, $key['public'])
&& \file_put_contents($private, $key['private'])
) {
$res = true;
}
}
return $res;
}
Generates a private and a public SSL certificate files. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions