aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/salmon.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/salmon.php b/include/salmon.php
new file mode 100644
index 000000000..7198f07c6
--- /dev/null
+++ b/include/salmon.php
@@ -0,0 +1,18 @@
+<?php
+
+require_once('library/asn1.php');
+
+function salmon_key($pubkey) {
+ $lines = explode("\n",$pubkey);
+ unset($lines[0]);
+ unset($lines[count($lines)]);
+ $x = base64_decode(implode('',$lines));
+
+ $r = ASN_BASE::parseASNString($x);
+
+ $m = $r[0]->asnData[1]->asnData[0]->asnData[0]->asnData;
+ $e = $r[0]->asnData[1]->asnData[0]->asnData[1]->asnData;
+
+
+ return 'RSA' . '.' . $m . '.' . $e ;
+}