aboutsummaryrefslogtreecommitdiffstats
path: root/include/salmon.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-12 04:07:03 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-12 04:07:03 -0700
commit013d2604f886bc7cbd2c5263d3577e8cf40f9fcc (patch)
tree437a1b2853211263dc290913c8a35ce8de441f53 /include/salmon.php
parentcc64742e2340038f4f14d1cdef492250b54c0a38 (diff)
downloadvolse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.tar.gz
volse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.tar.bz2
volse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.zip
inline salmon magic keys
Diffstat (limited to 'include/salmon.php')
-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 ;
+}