Skip to content

Instantly share code, notes, and snippets.

Created June 28, 2009 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/137310 to your computer and use it in GitHub Desktop.
Save anonymous/137310 to your computer and use it in GitHub Desktop.
<?php
function postSparul($uri, $sparul)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $uri);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $sparul);
curl_exec ($c);
curl_close ($c);
}
$webid = 'http://foaf.me/test';
$public_exponent = 65537;
$modulus = 'B5EBEFF72746A12FB96BE4FF73959C5163D342BF21A1046DBD3EE181FC6654D29903AE97764D8E8CBAF4B830A79073BECD0AAAD5FC9C9847551A9CEF548AE2CDFD4F0B6578CD31CEB711EEFF0CB7F9F922FA107CCDCE4832CCB51D7C319069168DEE3801F5490F6D21BD8211918F40749A99A4ECDF872AA59CA861AC36D010B1';
postSparul("$webid", "INSERT { <$webid#cert> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/auth/rsa#RSAPublicKey> ; <http://www.w3.org/ns/auth/cert#identity> <$webid#me> ; <http://www.w3.org/ns/auth/rsa#modulus> <$webid#modulus> ; <http://www.w3.org/ns/auth/rsa#public_exponent> <$webid#public_exponent> . <$webid#modulus> <http://www.w3.org/ns/auth/cert#hex> \"$modulus\" . <$webid#public_exponent> <http://www.w3.org/ns/auth/cert#decimal> \"$public_exponent\" . }");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment