forked from eschnou/node-ostatus
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,24 +1,17 @@ | |||
#!/usr/bin/env node | #!/usr/bin/env node | ||
|
|
||
var Util = require('util'); | var Util = require('util'); | ||
var Bn = require('bignumber'); | var Salmon = require('../lib/ostatus').salmon; | ||
var Salmon = require('ostatus').salmon; | |||
|
|
||
var bits = 2048; | |||
var exponent = 'deadbeef'; | |||
|
|
||
|
|||
var key = new Bn.Key(); | |||
Util.puts("Generating key... this can take a while due to pure-JSness"); | Util.puts("Generating key... this can take a while due to pure-JSness"); | ||
key.generate(bits, exponent); | var keys = Salmon.generateKeys(); | ||
|
|
||
// Public | // Public | ||
Util.puts("Public key:"); | Util.puts("Public key:"); | ||
Util.puts("data:application/magic-public-key,RSA." + | Util.puts("data:application/magic-public-key," + keys.public); | ||
Salmon.base64url_encode(key.n.toByteArray()) + | Util.puts("(Put it in your user's LRDD file)"); | ||
"." + | |||
Salmon.base64url_encode(new Bn.BigInteger(exponent, 16).toByteArray())); | |||
|
|
||
// Private | // Private | ||
Util.puts("Private key:"); | Util.puts("Private key:"); | ||
Util.puts(Salmon.base64url_encode(key.d.toByteArray())); | Util.puts(keys.private); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters