diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-12 04:07:03 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-12 04:07:03 -0700 |
commit | 013d2604f886bc7cbd2c5263d3577e8cf40f9fcc (patch) | |
tree | 437a1b2853211263dc290913c8a35ce8de441f53 /include | |
parent | cc64742e2340038f4f14d1cdef492250b54c0a38 (diff) | |
download | volse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.tar.gz volse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.tar.bz2 volse-hubzilla-013d2604f886bc7cbd2c5263d3577e8cf40f9fcc.zip |
inline salmon magic keys
Diffstat (limited to 'include')
-rw-r--r-- | include/salmon.php | 18 |
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 ; +} |