Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Adds grunt
Browse files Browse the repository at this point in the history
Just type `npm install && grunt` and the code will get:
- linted
- built
- minimized
- unittested (in Chrome)
  • Loading branch information
alokmenghrajani committed Nov 25, 2014
1 parent 5e5848f commit 2a8abe2
Show file tree
Hide file tree
Showing 14 changed files with 610 additions and 2,755 deletions.
51 changes: 51 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

jshint: {
all: ['Gruntfile.js', 'lib/*.js']
},

concat: {
dist: {
src: [
'lib/jose-jwe-core.js',
'lib/jose-jwe-utils.js',
'lib/jose-jwe-encrypt.js'
],
dest: 'dist/jose-jwe.js'
}
},

uglify: {
dist: {
src: 'dist/jose-jwe.js',
dest: 'dist/jose-jwe.min.js'
}
},

karma: {
continuous: {
options: {
frameworks: ['qunit'],
files: [
{pattern: 'dist/jose-jwe.js', watching: false, included: false},
{pattern: 'test/qunit-promises.js', watching: false, included: false},
'test/jose-jwe-test.html'
],
autoWatch: true,
browsers: ['Chrome'],
singleRun: true
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');

grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'karma']);
};
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ following versions of the drafts:
Example usage
-------------

<script src="jose-jwe.js"></script>
<script src="jose-jwe-encrypt.js"></script>
<script src="jose-jwe-utils.js"></script>
<script src="jose-jwe.min.js"></script>
var joseJWE = new JoseJWE();
var rsa_key = JoseJWE.Utils.importRsaKeyFromHex({
"n": "c2:4b:af:0f:2d:2b:ad:36:72:a7:91:0f:ee:30:a0:95:d5:3a:46:82:86:96:7e:42:c6:fe:8f:20:97:af:49:f6:48:a3:91:53:ac:2e:e6:ec:9a:9a:e0:0a:fb:1c:db:44:40:5b:8c:fc:d5:1c:cb:b6:9b:60:c0:a8:ac:06:f1:6b:29:5e:2f:7b:09:d9:93:32:da:3f:db:53:9c:2e:ea:3b:41:7f:6b:c9:7b:88:9f:2e:c5:dd:42:1e:7f:8f:04:f6:60:3c:fe:43:6d:32:10:ce:8d:99:cb:76:f7:10:97:05:af:28:1e:39:0f:78:35:50:7b:8e:28:22:a4:7d:11:51:22:d1:0e:ab:6b:6f:96:cb:cf:7d:eb:c6:aa:a2:6a:2e:97:2a:93:af:a5:89:e6:c8:bc:9f:fd:85:2b:0f:b4:c0:e4:ca:b5:a7:9a:01:05:81:93:6b:f5:8d:1c:f7:f3:77:0e:6e:53:34:92:0f:48:21:34:33:44:14:5e:4a:00:41:3a:7d:cb:38:82:c1:65:e0:79:ea:a1:05:84:b2:6e:40:19:77:1a:0e:38:4b:28:1f:34:b5:cb:ac:c5:2f:58:51:d7:ec:a8:08:0e:7c:c0:20:c1:5e:a1:4d:b1:30:17:63:0e:e7:58:8e:7f:6e:9f:a4:77:8b:1e:a2:d2:2e:1b:e9",
Expand Down Expand Up @@ -58,6 +56,14 @@ Content Encryption:
* A256GCM (default)


Building
--------

* `npm install`
* `grunt`



Some background info
--------------------

Expand All @@ -73,10 +79,10 @@ probably needs a thin abstraction layer.

Some other interesting resources:

* Web Crypto API polyfill (_no longer under active development_): http://polycrypt.net/
* Netflix' Web Crypto API polyfill: https://github.com/Netflix/NfWebCrypto
* Web Crypto API polyfill (_no longer under active development_): http://polycrypt.net/
* Netflix' Web Crypto API polyfill: https://github.com/Netflix/NfWebCrypto
* JWT: https://github.com/michaelrhanson/jwt-js
* BigInt, RSA, ECC: http://www-cs-students.stanford.edu/~tjw/jsbn/
* asn1, pem, x509 and more: http://kjur.github.io/jsrsasign/ and
https://github.com/michaelrhanson/jwt-js/tree/master/lib/kurushima-jsrsa
https://github.com/michaelrhanson/jwt-js/tree/master/lib/kurushima-jsrsa
* Stanford Javascript Crypto library: https://github.com/bitwiseshiftleft/sjcl
Loading

0 comments on commit 2a8abe2

Please sign in to comment.