mfance-shark-v1 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export declare class CryptoService {
|
|
2
|
-
private
|
|
3
|
-
private
|
|
4
|
-
|
|
2
|
+
private privateKey;
|
|
3
|
+
private publicKey;
|
|
4
|
+
private path;
|
|
5
|
+
constructor();
|
|
6
|
+
setPath(path: string): this;
|
|
7
|
+
loadKeys(): this;
|
|
5
8
|
encryptData(data: string): string;
|
|
6
9
|
decryptData(encryptedData: string): string;
|
|
7
10
|
}
|
|
@@ -14,9 +14,16 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const fs = require("fs");
|
|
15
15
|
const crypto = require("crypto");
|
|
16
16
|
let CryptoService = class CryptoService {
|
|
17
|
-
constructor(
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
constructor() {
|
|
18
|
+
}
|
|
19
|
+
setPath(path) {
|
|
20
|
+
this.path = path;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
loadKeys() {
|
|
24
|
+
this.privateKey = fs.readFileSync(this.path + '/private.pem', 'utf8');
|
|
25
|
+
this.publicKey = fs.readFileSync(this.path + '/public.pem', 'utf8');
|
|
26
|
+
return this;
|
|
20
27
|
}
|
|
21
28
|
encryptData(data) {
|
|
22
29
|
const buffer = Buffer.from(data, 'utf8');
|
|
@@ -32,6 +39,6 @@ let CryptoService = class CryptoService {
|
|
|
32
39
|
exports.CryptoService = CryptoService;
|
|
33
40
|
exports.CryptoService = CryptoService = __decorate([
|
|
34
41
|
(0, common_1.Injectable)(),
|
|
35
|
-
__metadata("design:paramtypes", [
|
|
42
|
+
__metadata("design:paramtypes", [])
|
|
36
43
|
], CryptoService);
|
|
37
44
|
//# sourceMappingURL=cryptoService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cryptoService.js","sourceRoot":"","sources":["../../../src/services/crypto/cryptoService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yBAAyB;AACzB,iCAAiC;AAG1B,IAAM,aAAa,GAAnB,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"cryptoService.js","sourceRoot":"","sources":["../../../src/services/crypto/cryptoService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yBAAyB;AACzB,iCAAiC;AAG1B,IAAM,aAAa,GAAnB,MAAM,aAAa;IAKxB;IAEA,CAAC;IAGD,OAAO,CAAC,IAAY;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,GAAG,cAAc,EAAE,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,GAAG,aAAa,EAAE,MAAM,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,WAAW,CAAC,IAAY;QACtB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC/D,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAGD,WAAW,CAAC,aAAqB;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjE,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAlCY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;;GACA,aAAa,CAkCzB"}
|