We have published the keystore file functionality for everyone to use.
The hope is that instead of getting several different implementations of this functionality, we can all congregate around one.

Github:
https://github.com/stellarport/stellar-keystore

npm:
https://www.npmjs.com/package/stellar-keystore

Additionally, we have had our library audited by a 3rd party dev (author of TweetNaCl.js):
https://github.com/stellarport/stellar-keystore/blob/master/audit.pdf

Enjoy!

    istrau2

    What is it supposed to be used for? How do I extract the key from the keystore?
    There seems to be a lot of missing functionality here.

      dzham

      .keypair() I guess..

      Everything assumes I have keys stored in files, which seems a bit restrictive

        dzham

        Yes, you're probably right. There should probably be a method that takes a json object (i.e file contents in json form) and returns a keypair. Then wrap that method in a method that takes a file (similar to the create methods).

        @dzham ok, updated the keypair() and publicKey() methods to accept object or blob. Also updated the readme.

        6 months later

        istrau2

        I tried it but I get this error

        var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(keystore) {
                                                           ^
        ReferenceError: regeneratorRuntime is not defined
            at C:\DevProjects\blockchain\keystore\node_modules\stellar-keystore\dist\index.js:51:52
            at C:\DevProjects\blockchain\keystore\node_modules\stellar-keystore\dist\index.js:90:6
            at Object.<anonymous> (C:\DevProjects\blockchain\keystore\node_modules\stellar-keystore\dist\index.js:304:2)
            at Module._compile (module.js:652:30)
            at Object.Module._extensions..js (module.js:663:10)
            at Module.load (module.js:565:32)
            at tryModuleLoad (module.js:505:12)
            at Function.Module._load (module.js:497:3)
            at Module.require (module.js:596:17)
            at require (internal/module.js:11:18)
            at Object.<anonymous> (C:\DevProjects\blockchain\keystore\mykeystore.js:1:85)
            at Module._compile (module.js:652:30)
            at Object.Module._extensions..js (module.js:663:10)
            at Module.load (module.js:565:32)
            at tryModuleLoad (module.js:505:12)
            at Function.Module._load (module.js:497:3)
          4 days later

          TraA-Li Hi, sorry about that. I've published a new version, try it now.

          p.s. you could fix that error in the future by including babel-polyfiill. The new version won't need it though.

          9 months later