当前位置: 首页>>代码示例>>PHP>>正文


PHP cert_get_subject函数代码示例

本文整理汇总了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;
}
开发者ID:karawan,项目名称:core,代码行数:38,代码来源:system_camanager.php

示例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) {
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:system_camanager.php


注:本文中的cert_get_subject函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。