@hapiness/crypto
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -69,3 +69,12 @@ "use strict"; | ||
const bufFinal = decipher.final(); | ||
this.destination.next(buffer_1.Buffer.concat([bufDecrypted, bufFinal])); | ||
let decrypted; | ||
// check if we have extra content | ||
/* istanbul ignore else */ | ||
if (bufFinal) { | ||
decrypted = buffer_1.Buffer.concat([bufDecrypted, bufFinal]); | ||
} | ||
else { | ||
decrypted = bufDecrypted; | ||
} | ||
this.destination.next(decrypted); | ||
this.destination.complete(); | ||
@@ -72,0 +81,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Subscriber_1 = require("rxjs/Subscriber"); | ||
const buffer_1 = require("buffer"); | ||
const crypto_1 = require("crypto"); | ||
const Subscriber_1 = require("rxjs/Subscriber"); | ||
/** | ||
@@ -69,3 +69,12 @@ * New observable operator | ||
const bufFinal = cipher.final(); | ||
this.destination.next(buffer_1.Buffer.concat([bufEncrypted, bufFinal])); | ||
let encrypted; | ||
// check if we have extra content | ||
/* istanbul ignore else */ | ||
if (bufFinal) { | ||
encrypted = buffer_1.Buffer.concat([bufEncrypted, bufFinal]); | ||
} | ||
else { | ||
encrypted = bufEncrypted; | ||
} | ||
this.destination.next(encrypted); | ||
this.destination.complete(); | ||
@@ -72,0 +81,0 @@ } |
@@ -156,2 +156,4 @@ <img src="http://bit.ly/2mxmKKI" width="500" alt="Hapiness" /> | ||
* Fix operators (2018-11-15) | ||
* Fix of `cipher.final()` in `AESService.encryptWithAesKey()` and `AESService.decryptWithAesKey()` operators | ||
* Implementation of all methods (2017-12-19) | ||
@@ -158,0 +160,0 @@ * [.createKey(password, salt)](#createkeypassword-salt) |
@@ -9,2 +9,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var CryptoModule_1; | ||
const core_1 = require("@hapiness/core"); | ||
@@ -35,3 +36,2 @@ const services_1 = require("./services"); | ||
exports.CryptoModule = CryptoModule; | ||
var CryptoModule_1; | ||
//# sourceMappingURL=crypto.module.js.map |
@@ -70,3 +70,3 @@ import { Observable } from 'rxjs/Observable'; | ||
export declare class PEMService { | ||
private _config; | ||
private _config?; | ||
/** | ||
@@ -73,0 +73,0 @@ * Class constructor |
@@ -1,2 +0,1 @@ | ||
/// <reference types="randomstring" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -3,0 +2,0 @@ import { GenerateOptions } from 'randomstring'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -3,0 +2,0 @@ import * as NodeRSA from 'node-rsa'; |
@@ -1,1 +0,1 @@ | ||
{"name":"@hapiness/crypto","version":"1.0.0","description":"Crypto module provides some functions for security features like AES key, Key pair, RSA key, PKCS12, Certificate, PEM and more","main":"index.js","types":"index.d.ts","private":false,"repository":{"type":"git","url":"git@github.com:hapinessjs/crypto-module.git"},"keywords":["Crypto","RSA","PEM","PrivateKey","PublicKey","Certificate","RandomString","AES","PKCS12","KeyPair","JWT","Hapiness","Framework","NodeJS","Node","HTTP","API","REST","Streams","Async","Decorator","RxJS","Rx","ReactiveX","Observable","Observer","Module","ES2015","ES2016","ES2017","ES6","ES7","ES8","Typescript"],"contributors":[{"name":"Julien Fauville","url":"https://github.com/Juneil"},{"name":"Antoine Gomez","url":"https://github.com/antoinegomez"},{"name":"Sébastien Ritz","url":"https://github.com/srz09"},{"name":"Nicolas Jessel","url":"https://github.com/njl07"}],"license":"SEE LICENSE IN https://github.com/hapinessjs/crypto-module/blob/master/LICENSE.md","bugs":{"url":"https://github.com/hapinessjs/crypto-module/issues"},"homepage":"https://github.com/hapinessjs/crypto-module#readme","dependencies":{"@types/jsonwebtoken":"^7.2.5","@types/node":"^8.5.1","@types/node-rsa":"^0.4.1","@types/pem":"^1.9.3","@types/randomstring":"^1.1.6","jsonwebtoken":"^8.1.0","node-rsa":"^0.4.2","pem":"^1.12.3","randomstring":"^1.1.5"},"peerDependencies":{"@hapiness/core":"^1.3.0","rxjs":"^5.5.5"},"engines":{"node":">=7.0.0"}} | ||
{"name":"@hapiness/crypto","version":"1.0.1","description":"Crypto module provides some functions for security features like AES key, Key pair, RSA key, PKCS12, Certificate, PEM and more","main":"index.js","types":"index.d.ts","private":false,"repository":{"type":"git","url":"git@github.com:hapinessjs/crypto-module.git"},"keywords":["Crypto","RSA","PEM","PrivateKey","PublicKey","Certificate","RandomString","AES","PKCS12","KeyPair","JWT","Hapiness","Framework","NodeJS","Node","HTTP","API","REST","Streams","Async","Decorator","RxJS","Rx","ReactiveX","Observable","Observer","Module","ES2015","ES2016","ES2017","ES6","ES7","ES8","Typescript"],"contributors":[{"name":"Julien Fauville","url":"https://github.com/Juneil"},{"name":"Antoine Gomez","url":"https://github.com/antoinegomez"},{"name":"Sébastien Ritz","url":"https://github.com/srz09"},{"name":"Nicolas Jessel","url":"https://github.com/njl07"}],"license":"SEE LICENSE IN https://github.com/hapinessjs/crypto-module/blob/master/LICENSE.md","bugs":{"url":"https://github.com/hapinessjs/crypto-module/issues"},"homepage":"https://github.com/hapinessjs/crypto-module#readme","dependencies":{"@types/jsonwebtoken":"^8.3.0","@types/node":"^10.12.8","@types/node-rsa":"0.4.1","@types/pem":"^1.9.3","@types/randomstring":"^1.1.6","jsonwebtoken":"^8.4.0","node-rsa":"^0.4.2","pem":"^1.13.2","randomstring":"^1.1.5"},"peerDependencies":{"@hapiness/core":"^1.5.5","rxjs":"^5.5.5"},"engines":{"node":">=7.0.0"}} |
@@ -145,2 +145,4 @@ <img src="http://bit.ly/2mxmKKI" width="500" alt="Hapiness" /> | ||
* v1.0.1 (2018-11-15) | ||
* Fix of `cipher.final()` in `AESService.encryptWithAesKey()` and `AESService.decryptWithAesKey()` operators | ||
* v1.0.0 (2017-12-19) | ||
@@ -147,0 +149,0 @@ * Implementation of `CryptoModule` with `AESService`, `HashService`, `PEMService`, `RandomstringService` and `RSAService` |
/// <reference types="node" /> | ||
/// <reference types="node-rsa" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -4,0 +3,0 @@ import { Encoding } from 'node-rsa'; |
/// <reference types="node" /> | ||
/// <reference types="node-rsa" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -4,0 +3,0 @@ import { Encoding } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { Observable } from 'rxjs/Observable'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { Observable } from 'rxjs/Observable'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -3,0 +2,0 @@ import { Format, Key } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -3,0 +2,0 @@ import { Key, Format } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { Observable } from 'rxjs/Observable'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { Observable } from 'rxjs/Observable'; |
/// <reference types="node" /> | ||
/// <reference types="node-rsa" /> | ||
import { OperatorFunction } from 'rxjs/interfaces'; | ||
@@ -4,0 +3,0 @@ import { Encoding } from 'node-rsa'; |
/// <reference types="node" /> | ||
/// <reference types="node-rsa" /> | ||
import { OperatorFunction } from 'rxjs/interfaces'; | ||
@@ -4,0 +3,0 @@ import { Encoding } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { OperatorFunction } from 'rxjs/interfaces'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { OperatorFunction } from 'rxjs/interfaces'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
import { OperatorFunction } from 'rxjs/interfaces'; | ||
@@ -3,0 +2,0 @@ import { Format, Key } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
import { MonoTypeOperatorFunction } from 'rxjs/interfaces'; | ||
@@ -3,0 +2,0 @@ import { Key, Format } from 'node-rsa'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { OperatorFunction } from 'rxjs/interfaces'; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node-rsa" /> | ||
/// <reference types="node" /> | ||
@@ -3,0 +2,0 @@ import { OperatorFunction } from 'rxjs/interfaces'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
304588
179
0
+ Added@types/jsonwebtoken@8.5.9(transitive)
+ Added@types/node@10.17.60(transitive)
+ Added@types/node-rsa@0.4.1(transitive)
- Removed@types/jsonwebtoken@7.2.8(transitive)
- Removed@types/node@8.10.66(transitive)
- Removed@types/node-rsa@0.4.3(transitive)
Updated@types/jsonwebtoken@^8.3.0
Updated@types/node@^10.12.8
Updated@types/node-rsa@0.4.1
Updatedjsonwebtoken@^8.4.0
Updatedpem@^1.13.2