本文整理汇总了PHP中cert_get_modulus函数的典型用法代码示例。如果您正苦于以下问题:PHP cert_get_modulus函数的具体用法?PHP cert_get_modulus怎么用?PHP cert_get_modulus使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cert_get_modulus函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: csr_get_modulus
function csr_get_modulus($str_crt, $decode = true)
{
return cert_get_modulus($str_crt, $decode, 'csr');
}
示例2: array_push
if (preg_match("/[\\?\\>\\<\\&\\/\\\"\\']/", $_POST['descr'])) {
array_push($input_errors, "The field 'Descriptive Name' contains invalid characters.");
}
// old way
/* make sure this csr and certificate subjects match */
// $subj_csr = csr_get_subject($pconfig['csr'], false);
// $subj_cert = cert_get_subject($pconfig['cert'], false);
//
// if (!isset($_POST['ignoresubjectmismatch']) && !($_POST['ignoresubjectmismatch'] == "yes")) {
// if (strcmp($subj_csr, $subj_cert)) {
// $input_errors[] = sprintf(gettext("The certificate subject '%s' does not match the signing request subject."), $subj_cert);
// $subject_mismatch = true;
// }
// }
$mod_csr = csr_get_modulus($pconfig['csr'], false);
$mod_cert = cert_get_modulus($pconfig['cert'], false);
if (strcmp($mod_csr, $mod_cert)) {
// simply: if the moduli don't match, then the private key and public key won't match
$input_errors[] = sprintf(gettext("The certificate modulus does not match the signing request modulus."), $subj_cert);
$subject_mismatch = true;
}
/* if this is an AJAX caller then handle via JSON */
if (isAjax() && is_array($input_errors)) {
input_errors2Ajax($input_errors);
exit;
}
/* save modifications */
if (!$input_errors) {
$cert = $a_cert[$id];
$cert['descr'] = $pconfig['descr'];
csr_complete($cert, $pconfig['cert']);