globalid-crypto
v3.0.0
Published
Temporary web module to supplement or fold into globalid-crypto-library
Downloads
8
Readme
GLOBALID - Crypto Lib - Web version
Build
Polyfills for Edge are implemented using asmcrypto.js. This must be built before the library can be used. After installing the crypto-lib dependencies, do the following:
cd node_modules/asmcrypto.js
yarn
Unit tests
# runs unit tests in ./lib/tests in HeadlessChrome
CHROME_BIN=/your/path/to/chrome/if/necessary yarn test-web
# runs unit tests in Edge:
edge=true yarn test
Work in Progress
For the time being, this npm project is used to generate a lean npm package to be used in a web test runner.
Source files are from the existing globalid-crypto-library project and there is also an .npmignore file in this repo to ignore unwanted stuff like ios, android, react native configs and cocoapods etc.
Only command to execute is npm pack
which will pack the latest version of this module up.
Dependency Notes
RSA
All RSA libraries by default only allowed encryption by public key and decryption by private key, including the one used in this project 'node-rsa'.
node-rsa used an external libraries underneath the hood which was not limited to this and manually suppressed the functionality to enable encryption by private and decryption by public key - which is a global id requirement.
As such, the following 2 methods inside the node-rsa (NodeRSA.js) library has been modified to accept a third parameter to let this feature be toggle-able. The toggle is set to off by default so that normal use isn't affected.
This library has been referenced in from the Github url - https://github.com/Gorenjai/node-rsa
TODO Items
- [ ] Strip out existing node - tests folder since web test runner is separate
- [ ] Also look at seeing if some of the node related code in the index.file can be abstracted away since web does not need it. (loading up test runner etc for node and including /tests folder)
- [ ] Do we need to include Browserify bundling into this repo so that a dist file can be published here as the source.