本文整理汇总了PHP中cert_get_subject函数的典型用法代码示例。如果您正苦于以下问题:PHP cert_get_subject函数的具体用法?PHP cert_get_subject怎么用?PHP cert_get_subject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cert_get_subject函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ca_import
function ca_import(&$ca, $str, $key = "", $serial = 0)
{
global $config;
$ca['crt'] = base64_encode($str);
if (!empty($key)) {
$ca['prv'] = base64_encode($key);
}
if (!empty($serial)) {
$ca['serial'] = $serial;
}
$subject = cert_get_subject($str, false);
$issuer = cert_get_issuer($str, false);
// Find my issuer unless self-signed
if ($issuer != $subject) {
$issuer_crt =& lookup_ca_by_subject($issuer);
if ($issuer_crt) {
$ca['caref'] = $issuer_crt['refid'];
}
}
/* Correct if child certificate was loaded first */
if (is_array($config['ca'])) {
foreach ($config['ca'] as &$oca) {
$issuer = cert_get_issuer($oca['crt']);
if ($ca['refid'] != $oca['refid'] && $issuer == $subject) {
$oca['caref'] = $ca['refid'];
}
}
}
if (is_array($config['cert'])) {
foreach ($config['cert'] as &$cert) {
$issuer = cert_get_issuer($cert['crt']);
if ($issuer == $subject) {
$cert['caref'] = $ca['refid'];
}
}
}
return true;
}
示例2: gettext
</th>
<th><?php
echo gettext("Distinguished Name");
?>
</th>
<th><?php
echo gettext("Actions");
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($a_ca as $i => $ca) {
$name = htmlspecialchars($ca['descr']);
$subj = cert_get_subject($ca['crt']);
$issuer = cert_get_issuer($ca['crt']);
list($startdate, $enddate) = cert_get_dates($ca['crt']);
if ($subj == $issuer) {
$issuer_name = gettext("self-signed");
} else {
$issuer_name = gettext("external");
}
$subj = htmlspecialchars($subj);
$issuer = htmlspecialchars($issuer);
$certcount = 0;
$issuer_ca = lookup_ca($ca['caref']);
if ($issuer_ca) {
$issuer_name = $issuer_ca['descr'];
}
foreach ($a_cert as $cert) {