Compare commits
	
		
			No commits in common. "master" and "v1.2.1" have entirely different histories.
		
	
	
		
	
		
| @ -74,9 +74,7 @@ args.forEach(function (arg) { | |||||||
|       console.error("EC keys do not have bit lengths such as '" + opts.modulusLength + "'. Choose either the P-256 or P-384 'curve' instead."); |       console.error("EC keys do not have bit lengths such as '" + opts.modulusLength + "'. Choose either the P-256 or P-384 'curve' instead."); | ||||||
|       process.exit(1); |       process.exit(1); | ||||||
|     } |     } | ||||||
|     return; |  | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
|   if ('rsa' === larg) { |   if ('rsa' === larg) { | ||||||
|     set('kty', "RSA"); |     set('kty', "RSA"); | ||||||
|     if (opts.namedCurve) { |     if (opts.namedCurve) { | ||||||
| @ -236,9 +234,6 @@ function guess(txt, filename) { | |||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|   } catch(e) { |   } catch(e) { | ||||||
|     if (setJwt(txt.trim())) { |  | ||||||
|       return true; |  | ||||||
|     } |  | ||||||
|     try { |     try { | ||||||
|       var jwk = Eckles.importSync({ pem: txt }); |       var jwk = Eckles.importSync({ pem: txt }); | ||||||
|       // pem._string = txt;
 |       // pem._string = txt;
 | ||||||
| @ -537,7 +532,7 @@ function writeFile(name, key, priv) { | |||||||
|   } catch(e) { |   } catch(e) { | ||||||
|     // the file does not exist (or cannot be accessed)
 |     // the file does not exist (or cannot be accessed)
 | ||||||
|   } |   } | ||||||
|   fs.writeFileSync(name, key + "\n"); |   fs.writeFileSync(name, key); | ||||||
|   if (overwrite) { |   if (overwrite) { | ||||||
|     console.info("Overwrote " + (priv ? "private" : "public") + " key at '" + name + "'"); |     console.info("Overwrote " + (priv ? "private" : "public") + " key at '" + name + "'"); | ||||||
|   } else { |   } else { | ||||||
|  | |||||||
							
								
								
									
										42
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										42
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1,42 +0,0 @@ | |||||||
| { |  | ||||||
|   "name": "keypairs-cli", |  | ||||||
|   "version": "1.2.4", |  | ||||||
|   "lockfileVersion": 1, |  | ||||||
|   "requires": true, |  | ||||||
|   "dependencies": { |  | ||||||
|     "@coolaj86/urequest": { |  | ||||||
|       "version": "1.3.7", |  | ||||||
|       "resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz", |  | ||||||
|       "integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA==" |  | ||||||
|     }, |  | ||||||
|     "eckles": { |  | ||||||
|       "version": "1.4.1", |  | ||||||
|       "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.1.tgz", |  | ||||||
|       "integrity": "sha512-auWyk/k8oSkVHaD4RxkPadKsLUcIwKgr/h8F7UZEueFDBO7BsE4y+H6IMUDbfqKIFPg/9MxV6KcBdJCmVVcxSA==" |  | ||||||
|     }, |  | ||||||
|     "keyfetch": { |  | ||||||
|       "version": "1.1.8", |  | ||||||
|       "resolved": "https://registry.npmjs.org/keyfetch/-/keyfetch-1.1.8.tgz", |  | ||||||
|       "integrity": "sha512-a8E1E25mHiv2zZnrBM6WNfQi4hG43TgVg1JG/D61WiTBAM07OJzSuy3j00H2pWPF6MCofBmA+KTzSu145nZWuA==", |  | ||||||
|       "requires": { |  | ||||||
|         "@coolaj86/urequest": "^1.3.6", |  | ||||||
|         "eckles": "^1.4.0", |  | ||||||
|         "rasha": "^1.2.1" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "keypairs": { |  | ||||||
|       "version": "1.2.12", |  | ||||||
|       "resolved": "https://registry.npmjs.org/keypairs/-/keypairs-1.2.12.tgz", |  | ||||||
|       "integrity": "sha512-zYjYdDvo7G4AIkkZVM3WEJBTRUIrFzYswYNqCxcCPHUsgbBBdewSHAH1CiaQ+VA6Yb7BLEPIv8gFrRz5wJrgsw==", |  | ||||||
|       "requires": { |  | ||||||
|         "eckles": "^1.4.1", |  | ||||||
|         "rasha": "^1.2.4" |  | ||||||
|       } |  | ||||||
|     }, |  | ||||||
|     "rasha": { |  | ||||||
|       "version": "1.2.4", |  | ||||||
|       "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.4.tgz", |  | ||||||
|       "integrity": "sha512-GsIwKv+hYSumJyK9wkTDaERLwvWaGYh1WuI7JMTBISfYt13TkKFU/HFzlY4n72p8VfXZRUYm0AqaYhkZVxOC3Q==" |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| @ -1,10 +1,11 @@ | |||||||
| { | { | ||||||
|   "name": "keypairs-cli", |   "name": "keypairs-cli", | ||||||
|   "version": "1.2.5", |   "version": "1.2.1", | ||||||
|   "description": "CLI for Keypairs.js", |   "description": "CLI for Keypairs.js", | ||||||
|   "homepage": "https://git.coolaj86.com/coolaj86/keypairs-cli.js", |   "homepage": "https://git.coolaj86.com/coolaj86/keypairs-cli.js", | ||||||
|   "main": "bin/keypairs-cli.js", |   "main": "bin/keypairs-cli.js", | ||||||
|   "files": [ |   "files": [ | ||||||
|  |     "CLI.md", | ||||||
|     "bin/keypairs.js" |     "bin/keypairs.js" | ||||||
|   ], |   ], | ||||||
|   "scripts": { |   "scripts": { | ||||||
| @ -30,7 +31,7 @@ | |||||||
|   "author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)", |   "author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)", | ||||||
|   "license": "MPL-2.0", |   "license": "MPL-2.0", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "keyfetch": "^1.1.8", |     "keyfetch": "1.x", | ||||||
|     "keypairs": "^1.2.12" |     "keypairs": "1.x" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										15
									
								
								test.sh
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								test.sh
									
									
									
									
									
								
							| @ -1,15 +0,0 @@ | |||||||
| set -e |  | ||||||
| echo "" |  | ||||||
| echo "" |  | ||||||
| node bin/keypairs-cli.js gen > ./fixture.ec.jwk.json 2> ./fixture.ec.jwk.pub.json |  | ||||||
| node bin/keypairs-cli.js ./fixture.ec.jwk.json pkcs8 > fixture.ec.pem |  | ||||||
| node bin/keypairs-cli.js ./fixture.ec.pem > ./fixture.ec.jwk.json |  | ||||||
| 
 |  | ||||||
| node bin/keypairs-cli.js gen rsa > ./fixture.rsa.jwk.json 2> ./fixture.rsa.jwk.pub.json |  | ||||||
| node bin/keypairs-cli.js ./fixture.rsa.jwk.json pkcs1 > fixture.rsa.pem |  | ||||||
| node bin/keypairs-cli.js ./fixture.rsa.pem > ./fixture.rsa.jwk.json |  | ||||||
| 
 |  | ||||||
| node bin/keypairs-cli.js ./fixture.ec.jwk.json sign https://localhost:4080 '{}' 3d > works.txt; |  | ||||||
| node bin/keypairs-cli.js ./fixture.ec.jwk.pub.json decode works.txt |  | ||||||
| #node bin/keypairs-cli.js ./fixture.ec.jwk.pub.json decode works.txt |  | ||||||
| node bin/keypairs-cli.js ./fixture.ec.jwk.json sign https://localhost:4080 '{}' 3d > works.txt; |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user