summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_certmanager.php
diff options
context:
space:
mode:
authorMatthew Grooms <mgrooms@pfsense.org>2008-09-03 03:53:11 +0000
committerMatthew Grooms <mgrooms@pfsense.org>2008-09-03 03:53:11 +0000
commit93823b10147aa446945ed4b8ddef40cb56c96479 (patch)
tree8cf1074d7721e6f66ed9f72bb740b49f9f46cb0a /usr/local/www/system_certmanager.php
parent7da118047ac7a450227b25f2b5cb467b647585ea (diff)
downloadpfsense-93823b10147aa446945ed4b8ddef40cb56c96479.zip
pfsense-93823b10147aa446945ed4b8ddef40cb56c96479.tar.gz
Add options to export ca, certificate and user certificate data from the
webui.
Diffstat (limited to 'usr/local/www/system_certmanager.php')
-rw-r--r--usr/local/www/system_certmanager.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 7ca0ff4..4903c50 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -88,6 +88,24 @@ if ($act == "new") {
$pconfig['lifetime'] = "365";
}
+if ($act == "exp") {
+
+ if (!$a_cert[$id]) {
+ pfSenseHeader("system_certmanager.php");
+ exit;
+ }
+
+ $exp_name = urlencode("{$a_cert[$id]['name']}.crt");
+ $exp_data = base64_decode($a_cert[$id]['crt']);
+ $exp_size = strlen($exp_data);
+
+ header("Content-Type: application/octet-stream");
+ header("Content-Disposition: attachment; filename={$exp_name}");
+ header("Content-Length: $exp_size");
+ echo $exp_data;
+ exit;
+}
+
if ($act == "csr") {
if (!$a_cert[$id]) {
@@ -698,6 +716,9 @@ function internalca_change() {
<td class="listr"><?=$caname;?>&nbsp;</td>
<td class="listr"><?=$subj;?>&nbsp;</td>
<td valign="middle" nowrap class="list">
+ <a href="system_certmanager.php?act=exp&id=<?=$i;?>")">
+ <img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="export cert" alt="export ca" width="17" height="17" border="0" />
+ </a>
<a href="system_certmanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate?");?>')">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="delete cert" alt="delete cert" width="17" height="17" border="0" />
</a>
OpenPOWER on IntegriCloud