本文整理汇总了PHP中csr_generate函数的典型用法代码示例。如果您正苦于以下问题:PHP csr_generate函数的具体用法?PHP csr_generate怎么用?PHP csr_generate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了csr_generate函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$input_errors = array();
while ($ssl_err = openssl_error_string()) {
$input_errors[] = gettext("openssl library returns:") . " " . $ssl_err;
}
}
}
if ($pconfig['certmethod'] == "external") {
$dn = array('countryName' => $pconfig['csr_dn_country'], 'stateOrProvinceName' => $pconfig['csr_dn_state'], 'localityName' => $pconfig['csr_dn_city'], 'organizationName' => $pconfig['csr_dn_organization'], 'emailAddress' => $pconfig['csr_dn_email'], 'commonName' => $pconfig['csr_dn_commonname']);
if (count($altnames)) {
$altnames_tmp = "";
foreach ($altnames as $altname) {
$altnames_tmp[] = "{$altname['type']}:{$altname['value']}";
}
$dn['subjectAltName'] = implode(",", $altnames_tmp);
}
if (!csr_generate($cert, $pconfig['csr_keylen'], $dn, $pconfig['csr_digest_alg'])) {
$input_errors = array();
while ($ssl_err = openssl_error_string()) {
$input_errors[] = gettext("openssl library returns:") . " " . $ssl_err;
}
}
}
error_reporting($old_err_level);
if (isset($id)) {
$a_cert[$id] = $cert;
} else {
$a_cert[] = $cert;
}
if (isset($a_user) && isset($userid)) {
$a_user[$userid]['cert'][] = $cert['refid'];
}
示例2: cert_import
/* otherwise openssl_ functions throw warings directly to a page screwing menu tab */
if ($pconfig['method'] == "import") {
cert_import($cert, $pconfig['cert'], $pconfig['key']);
}
if ($pconfig['method'] == "internal") {
$dn = array('countryName' => $pconfig['dn_country'], 'stateOrProvinceName' => $pconfig['dn_state'], 'localityName' => $pconfig['dn_city'], 'organizationName' => $pconfig['dn_organization'], 'emailAddress' => $pconfig['dn_email'], 'commonName' => $pconfig['dn_commonname']);
if (!cert_create($cert, $pconfig['caref'], $pconfig['keylen'], $pconfig['lifetime'], $dn, $pconfig['type'])) {
while ($ssl_err = openssl_error_string()) {
$input_errors = array();
array_push($input_errors, "openssl library returns: " . $ssl_err);
}
}
}
if ($pconfig['method'] == "external") {
$dn = array('countryName' => $pconfig['csr_dn_country'], 'stateOrProvinceName' => $pconfig['csr_dn_state'], 'localityName' => $pconfig['csr_dn_city'], 'organizationName' => $pconfig['csr_dn_organization'], 'emailAddress' => $pconfig['csr_dn_email'], 'commonName' => $pconfig['csr_dn_commonname']);
if (!csr_generate($cert, $pconfig['csr_keylen'], $dn)) {
while ($ssl_err = openssl_error_string()) {
$input_errors = array();
array_push($input_errors, "openssl library returns: " . $ssl_err);
}
}
}
error_reporting($old_err_level);
if (isset($id) && $a_cert[$id]) {
$a_cert[$id] = $cert;
} else {
$a_cert[] = $cert;
}
if (isset($a_user) && isset($userid)) {
$a_user[$userid]['cert'][] = $cert['refid'];
}