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


PHP csr_generate函数代码示例

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

示例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'];
 }
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:system_certmanager.php


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