@edirect/encrypt-modules 10.1.0 → 11.0.26
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.
- package/README.md +9 -0
- package/dist/README.md +9 -0
- package/dist/package.json +54 -0
- package/dist/{aes-encrypt → src/aes-encrypt}/aes-encrypt.interface.d.ts +6 -7
- package/dist/src/aes-encrypt/aes-encrypt.interface.d.ts.map +1 -0
- package/dist/{aes-encrypt → src/aes-encrypt}/aes-encrypt.interface.js +0 -1
- package/dist/src/aes-encrypt/aes-encrypt.module.d.ts +3 -0
- package/dist/src/aes-encrypt/aes-encrypt.module.d.ts.map +1 -0
- package/dist/src/aes-encrypt/aes-encrypt.module.js +15 -0
- package/dist/{aes-encrypt → src/aes-encrypt}/aes-encrypt.service.d.ts +2 -2
- package/dist/src/aes-encrypt/aes-encrypt.service.d.ts.map +1 -0
- package/dist/{aes-encrypt → src/aes-encrypt}/aes-encrypt.service.js +21 -21
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.interface.d.ts +5 -0
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.interface.d.ts.map +1 -0
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.interface.js +2 -0
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.module.d.ts +3 -0
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.module.d.ts.map +1 -0
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.module.js +15 -0
- package/dist/{bin-pgp-encrypt → src/bin-pgp-encrypt}/bin-pgp-encrypt.service.d.ts +2 -1
- package/dist/src/bin-pgp-encrypt/bin-pgp-encrypt.service.d.ts.map +1 -0
- package/dist/{bin-pgp-encrypt → src/bin-pgp-encrypt}/bin-pgp-encrypt.service.js +5 -11
- package/dist/{index.d.ts → src/index.d.ts} +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/{index.js → src/index.js} +0 -1
- package/dist/{pgp-encrypt → src/pgp-encrypt}/pgp-encrypt.interface.d.ts +1 -0
- package/dist/src/pgp-encrypt/pgp-encrypt.interface.d.ts.map +1 -0
- package/dist/{pgp-encrypt → src/pgp-encrypt}/pgp-encrypt.interface.js +0 -1
- package/dist/src/pgp-encrypt/pgp-encrypt.module.d.ts +3 -0
- package/dist/src/pgp-encrypt/pgp-encrypt.module.d.ts.map +1 -0
- package/dist/src/pgp-encrypt/pgp-encrypt.module.js +15 -0
- package/dist/{pgp-encrypt → src/pgp-encrypt}/pgp-encrypt.service.d.ts +1 -0
- package/dist/src/pgp-encrypt/pgp-encrypt.service.d.ts.map +1 -0
- package/dist/{pgp-encrypt → src/pgp-encrypt}/pgp-encrypt.service.js +5 -11
- package/dist/{rsa-encrypt → src/rsa-encrypt}/rsa-encrypt.interface.d.ts +1 -1
- package/dist/src/rsa-encrypt/rsa-encrypt.interface.d.ts.map +1 -0
- package/dist/{rsa-encrypt → src/rsa-encrypt}/rsa-encrypt.interface.js +0 -1
- package/dist/src/rsa-encrypt/rsa-encrypt.module.d.ts +3 -0
- package/dist/src/rsa-encrypt/rsa-encrypt.module.d.ts.map +1 -0
- package/dist/src/rsa-encrypt/rsa-encrypt.module.js +15 -0
- package/dist/{rsa-encrypt → src/rsa-encrypt}/rsa-encrypt.service.d.ts +2 -2
- package/dist/src/rsa-encrypt/rsa-encrypt.service.d.ts.map +1 -0
- package/dist/src/rsa-encrypt/rsa-encrypt.service.js +22 -0
- package/dist/{zip-encrypt → src/zip-encrypt}/zipencrypt.interface.d.ts +1 -0
- package/dist/src/zip-encrypt/zipencrypt.interface.d.ts.map +1 -0
- package/dist/{zip-encrypt → src/zip-encrypt}/zipencrypt.interface.js +0 -1
- package/dist/src/zip-encrypt/zipencrypt.module.d.ts +3 -0
- package/dist/src/zip-encrypt/zipencrypt.module.d.ts.map +1 -0
- package/dist/src/zip-encrypt/zipencrypt.module.js +15 -0
- package/dist/{zip-encrypt → src/zip-encrypt}/zipencrypt.service.d.ts +1 -1
- package/dist/src/zip-encrypt/zipencrypt.service.d.ts.map +1 -0
- package/dist/{zip-encrypt → src/zip-encrypt}/zipencrypt.service.js +10 -12
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +44 -20
- package/.eslintrc.js +0 -24
- package/dist/aes-encrypt/aes-encrypt.interface.js.map +0 -1
- package/dist/aes-encrypt/aes-encrypt.module.d.ts +0 -2
- package/dist/aes-encrypt/aes-encrypt.module.js +0 -21
- package/dist/aes-encrypt/aes-encrypt.module.js.map +0 -1
- package/dist/aes-encrypt/aes-encrypt.service.js.map +0 -1
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.interface.d.ts +0 -4
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.interface.js +0 -3
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.interface.js.map +0 -1
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.module.d.ts +0 -2
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.module.js +0 -21
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.module.js.map +0 -1
- package/dist/bin-pgp-encrypt/bin-pgp-encrypt.service.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pgp-encrypt/pgp-encrypt.interface.js.map +0 -1
- package/dist/pgp-encrypt/pgp-encrypt.module.d.ts +0 -2
- package/dist/pgp-encrypt/pgp-encrypt.module.js +0 -21
- package/dist/pgp-encrypt/pgp-encrypt.module.js.map +0 -1
- package/dist/pgp-encrypt/pgp-encrypt.service.js.map +0 -1
- package/dist/rsa-encrypt/rsa-encrypt.interface.js.map +0 -1
- package/dist/rsa-encrypt/rsa-encrypt.module.d.ts +0 -2
- package/dist/rsa-encrypt/rsa-encrypt.module.js +0 -21
- package/dist/rsa-encrypt/rsa-encrypt.module.js.map +0 -1
- package/dist/rsa-encrypt/rsa-encrypt.service.js +0 -28
- package/dist/rsa-encrypt/rsa-encrypt.service.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/zip-encrypt/zipencrypt.interface.js.map +0 -1
- package/dist/zip-encrypt/zipencrypt.module.d.ts +0 -2
- package/dist/zip-encrypt/zipencrypt.module.js +0 -21
- package/dist/zip-encrypt/zipencrypt.module.js.map +0 -1
- package/dist/zip-encrypt/zipencrypt.service.js.map +0 -1
package/README.md
ADDED
package/dist/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@edirect/encrypt-modules",
|
|
3
|
+
"version": "11.0.26",
|
|
4
|
+
"description": "Encrypt Modules",
|
|
5
|
+
"packageScope": "@edirect",
|
|
6
|
+
"main": "./dist/src/index.js",
|
|
7
|
+
"types": "./dist/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"development": "./src/index.ts",
|
|
11
|
+
"default": "./dist/src/index.js",
|
|
12
|
+
"require": "./dist/src/index.js",
|
|
13
|
+
"types": "./dist/src/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@nestjs/common": "^11.1.6",
|
|
22
|
+
"archiver-zip-encrypted": "^2.0.0",
|
|
23
|
+
"node-rsa": "1.1.1",
|
|
24
|
+
"openpgp": "^6.2.2",
|
|
25
|
+
"stream-buffers": "^3.0.3",
|
|
26
|
+
"archiver": "7.0.1",
|
|
27
|
+
"tslib": "^2.8.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@nestjs/cli": "^11.0.10",
|
|
31
|
+
"@types/archiver": "^6.0.3",
|
|
32
|
+
"@types/node": "^24.3.1",
|
|
33
|
+
"@types/node-rsa": "^1.1.4",
|
|
34
|
+
"@types/stream-buffers": "^3.0.7"
|
|
35
|
+
},
|
|
36
|
+
"nx": {
|
|
37
|
+
"name": "@edirect/encrypt-modules",
|
|
38
|
+
"targets": {
|
|
39
|
+
"build": {
|
|
40
|
+
"executor": "@nx/js:tsc",
|
|
41
|
+
"options": {
|
|
42
|
+
"main": "{workspaceRoot}/packages/edirect-encrypt-modules/src/index.ts",
|
|
43
|
+
"tsConfig": "{workspaceRoot}/packages/edirect-encrypt-modules/tsconfig.lib.json",
|
|
44
|
+
"outputPath": "{workspaceRoot}/packages/edirect-encrypt-modules/dist",
|
|
45
|
+
"assets": [
|
|
46
|
+
"{workspaceRoot}/packages/edirect-encrypt-modules/package.json",
|
|
47
|
+
"{workspaceRoot}/packages/edirect-encrypt-modules/README.md"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"type": "commonjs"
|
|
54
|
+
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { CipherKey, BinaryLike, CipherCCMTypes, Utf8AsciiBinaryEncoding, HexBase64BinaryEncoding } from 'crypto';
|
|
1
|
+
import { BinaryLike, CipherCCMTypes, CipherKey, Encoding } from 'crypto';
|
|
4
2
|
import { TransformOptions } from 'stream';
|
|
5
3
|
type encryptionMethods = CipherCCMTypes | 'aes-256-cbc';
|
|
6
4
|
export interface IaesEncryptOptionalParameters {
|
|
7
5
|
iv?: BinaryLike;
|
|
8
6
|
encryptionMethod?: encryptionMethods;
|
|
9
|
-
inputEncoding?:
|
|
10
|
-
outputEncoding?:
|
|
7
|
+
inputEncoding?: Encoding;
|
|
8
|
+
outputEncoding?: Encoding;
|
|
11
9
|
options?: TransformOptions;
|
|
12
10
|
}
|
|
13
11
|
export interface IaesDecryptOptionalParameters {
|
|
14
12
|
iv?: BinaryLike;
|
|
15
13
|
encryptionMethod?: encryptionMethods;
|
|
16
|
-
inputEncoding?:
|
|
17
|
-
outputEncoding?:
|
|
14
|
+
inputEncoding?: Encoding;
|
|
15
|
+
outputEncoding?: Encoding;
|
|
18
16
|
options?: TransformOptions;
|
|
19
17
|
}
|
|
20
18
|
export interface AesEncryptInterface {
|
|
@@ -22,3 +20,4 @@ export interface AesEncryptInterface {
|
|
|
22
20
|
decrypt(encryptedMessage: string, passphrase: BinaryLike, optionalParameters?: IaesDecryptOptionalParameters): string;
|
|
23
21
|
}
|
|
24
22
|
export {};
|
|
23
|
+
//# sourceMappingURL=aes-encrypt.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aes-encrypt.interface.d.ts","sourceRoot":"","sources":["../../../src/aes-encrypt/aes-encrypt.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C,KAAK,iBAAiB,GAAG,cAAc,GAAG,aAAa,CAAC;AAExD,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CACL,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,EACrB,kBAAkB,CAAC,EAAE,6BAA6B,GACjD,MAAM,CAAC;IAEV,OAAO,CACL,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,kBAAkB,CAAC,EAAE,6BAA6B,GACjD,MAAM,CAAC;CACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aes-encrypt.module.d.ts","sourceRoot":"","sources":["../../../src/aes-encrypt/aes-encrypt.module.ts"],"names":[],"mappings":"AAGA,qBAIa,gBAAgB;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AesEncryptModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const aes_encrypt_service_1 = require("./aes-encrypt.service");
|
|
7
|
+
let AesEncryptModule = class AesEncryptModule {
|
|
8
|
+
};
|
|
9
|
+
exports.AesEncryptModule = AesEncryptModule;
|
|
10
|
+
exports.AesEncryptModule = AesEncryptModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [aes_encrypt_service_1.AesEncryptService],
|
|
13
|
+
exports: [aes_encrypt_service_1.AesEncryptService],
|
|
14
|
+
})
|
|
15
|
+
], AesEncryptModule);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { CipherKey, BinaryLike } from 'crypto';
|
|
1
|
+
import { BinaryLike, CipherKey } from 'crypto';
|
|
3
2
|
import { AesEncryptInterface, IaesDecryptOptionalParameters, IaesEncryptOptionalParameters } from './aes-encrypt.interface';
|
|
4
3
|
export declare class AesEncryptService implements AesEncryptInterface {
|
|
5
4
|
encrypt(message: string, passphrase: CipherKey, optionalParameters?: IaesEncryptOptionalParameters): string;
|
|
6
5
|
decrypt(encryptedMessage: string, passphrase: BinaryLike, optionalParameters?: IaesDecryptOptionalParameters): string;
|
|
7
6
|
}
|
|
7
|
+
//# sourceMappingURL=aes-encrypt.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aes-encrypt.service.d.ts","sourceRoot":"","sources":["../../../src/aes-encrypt/aes-encrypt.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,yBAAyB,CAAC;AAEjC,qBACa,iBAAkB,YAAW,mBAAmB;IACpD,OAAO,CACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,EACrB,kBAAkB,GAAE,6BAAkC,GACrD,MAAM;IAyBF,OAAO,CACZ,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,kBAAkB,GAAE,6BAAkC,GACrD,MAAM;CAwBV"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.AesEncryptService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
10
5
|
const common_1 = require("@nestjs/common");
|
|
11
6
|
const crypto_1 = require("crypto");
|
|
12
7
|
let AesEncryptService = class AesEncryptService {
|
|
13
8
|
encrypt(message, passphrase, optionalParameters = {}) {
|
|
14
|
-
optionalParameters =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
optionalParameters = {
|
|
10
|
+
...{
|
|
11
|
+
iv: Buffer.alloc(16).fill(0),
|
|
12
|
+
encryptionMethod: 'aes-256-cbc',
|
|
13
|
+
inputEncoding: 'utf8',
|
|
14
|
+
outputEncoding: 'hex',
|
|
15
|
+
},
|
|
16
|
+
...optionalParameters,
|
|
17
|
+
};
|
|
20
18
|
const cipher = (0, crypto_1.createCipheriv)(optionalParameters.encryptionMethod, passphrase, optionalParameters.iv, optionalParameters.options);
|
|
21
19
|
let result = cipher.update(message, optionalParameters.inputEncoding, optionalParameters.outputEncoding);
|
|
22
20
|
result += cipher.final(optionalParameters.outputEncoding);
|
|
23
21
|
return result;
|
|
24
22
|
}
|
|
25
23
|
decrypt(encryptedMessage, passphrase, optionalParameters = {}) {
|
|
26
|
-
optionalParameters =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
optionalParameters = {
|
|
25
|
+
...{
|
|
26
|
+
encryptionMethod: 'aes-256-cbc',
|
|
27
|
+
iv: Buffer.alloc(16).fill(0),
|
|
28
|
+
inputEncoding: 'hex',
|
|
29
|
+
outputEncoding: 'utf8',
|
|
30
|
+
},
|
|
31
|
+
...optionalParameters,
|
|
32
|
+
};
|
|
32
33
|
const decipher = (0, crypto_1.createDecipheriv)(optionalParameters.encryptionMethod, passphrase, optionalParameters.iv, optionalParameters.options);
|
|
33
34
|
let result = decipher.update(encryptedMessage, optionalParameters.inputEncoding, optionalParameters.outputEncoding);
|
|
34
35
|
result += decipher.final(optionalParameters.outputEncoding);
|
|
35
36
|
return result;
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
AesEncryptService =
|
|
39
|
+
exports.AesEncryptService = AesEncryptService;
|
|
40
|
+
exports.AesEncryptService = AesEncryptService = tslib_1.__decorate([
|
|
39
41
|
(0, common_1.Injectable)()
|
|
40
42
|
], AesEncryptService);
|
|
41
|
-
exports.AesEncryptService = AesEncryptService;
|
|
42
|
-
//# sourceMappingURL=aes-encrypt.service.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface IBinPgpEncryptModuleInterface {
|
|
2
|
+
encrypt(pgpKey: string, dataToEncrypt: unknown): Promise<string>;
|
|
3
|
+
decrypt(pgpKey: string, encryptedData: Buffer | Uint8Array | string, passphrase?: string): Promise<string>;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=bin-pgp-encrypt.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-pgp-encrypt.interface.d.ts","sourceRoot":"","sources":["../../../src/bin-pgp-encrypt/bin-pgp-encrypt.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjE,OAAO,CACL,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,EAC3C,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-pgp-encrypt.module.d.ts","sourceRoot":"","sources":["../../../src/bin-pgp-encrypt/bin-pgp-encrypt.module.ts"],"names":[],"mappings":"AAGA,qBAIa,mBAAmB;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BinPgpEncryptModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const bin_pgp_encrypt_service_1 = require("./bin-pgp-encrypt.service");
|
|
7
|
+
let BinPgpEncryptModule = class BinPgpEncryptModule {
|
|
8
|
+
};
|
|
9
|
+
exports.BinPgpEncryptModule = BinPgpEncryptModule;
|
|
10
|
+
exports.BinPgpEncryptModule = BinPgpEncryptModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [bin_pgp_encrypt_service_1.BinPgpEncryptService],
|
|
13
|
+
exports: [bin_pgp_encrypt_service_1.BinPgpEncryptService],
|
|
14
|
+
})
|
|
15
|
+
], BinPgpEncryptModule);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IBinPgpEncryptModuleInterface } from './bin-pgp-encrypt.interface';
|
|
2
2
|
export declare class BinPgpEncryptService implements IBinPgpEncryptModuleInterface {
|
|
3
3
|
encrypt(pgpKey: string, dataToEncrypt: any): Promise<string>;
|
|
4
|
-
decrypt(pgpKey: string, encryptedData:
|
|
4
|
+
decrypt(pgpKey: string, encryptedData: Buffer | Uint8Array | string, passphrase?: string): Promise<string>;
|
|
5
5
|
}
|
|
6
|
+
//# sourceMappingURL=bin-pgp-encrypt.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-pgp-encrypt.service.d.ts","sourceRoot":"","sources":["../../../src/bin-pgp-encrypt/bin-pgp-encrypt.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAE5E,qBACa,oBAAqB,YAAW,6BAA6B;IAC3D,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAgB5D,OAAO,CAClB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,EAC3C,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;CA2CnB"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.BinPgpEncryptService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
10
5
|
const common_1 = require("@nestjs/common");
|
|
11
|
-
const openpgp = require("openpgp");
|
|
6
|
+
const openpgp = tslib_1.__importStar(require("openpgp"));
|
|
12
7
|
let BinPgpEncryptService = class BinPgpEncryptService {
|
|
13
8
|
async encrypt(pgpKey, dataToEncrypt) {
|
|
14
9
|
try {
|
|
@@ -39,7 +34,7 @@ let BinPgpEncryptService = class BinPgpEncryptService {
|
|
|
39
34
|
},
|
|
40
35
|
};
|
|
41
36
|
let privateKey = openpgpPrivatekey;
|
|
42
|
-
if (
|
|
37
|
+
if (passphrase) {
|
|
43
38
|
decryptKeyOptions.passphrase = passphrase;
|
|
44
39
|
privateKey = await openpgp.decryptKey(decryptKeyOptions);
|
|
45
40
|
}
|
|
@@ -62,8 +57,7 @@ let BinPgpEncryptService = class BinPgpEncryptService {
|
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
};
|
|
65
|
-
BinPgpEncryptService =
|
|
60
|
+
exports.BinPgpEncryptService = BinPgpEncryptService;
|
|
61
|
+
exports.BinPgpEncryptService = BinPgpEncryptService = tslib_1.__decorate([
|
|
66
62
|
(0, common_1.Injectable)()
|
|
67
63
|
], BinPgpEncryptService);
|
|
68
|
-
exports.BinPgpEncryptService = BinPgpEncryptService;
|
|
69
|
-
//# sourceMappingURL=bin-pgp-encrypt.service.js.map
|
|
@@ -8,3 +8,4 @@ export { BinPgpEncryptModule } from './bin-pgp-encrypt/bin-pgp-encrypt.module';
|
|
|
8
8
|
export { BinPgpEncryptService } from './bin-pgp-encrypt/bin-pgp-encrypt.service';
|
|
9
9
|
export { ZipEncryptModule } from './zip-encrypt/zipencrypt.module';
|
|
10
10
|
export { ZipEncryptService } from './zip-encrypt/zipencrypt.service';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -21,4 +21,3 @@ var zipencrypt_module_1 = require("./zip-encrypt/zipencrypt.module");
|
|
|
21
21
|
Object.defineProperty(exports, "ZipEncryptModule", { enumerable: true, get: function () { return zipencrypt_module_1.ZipEncryptModule; } });
|
|
22
22
|
var zipencrypt_service_1 = require("./zip-encrypt/zipencrypt.service");
|
|
23
23
|
Object.defineProperty(exports, "ZipEncryptService", { enumerable: true, get: function () { return zipencrypt_service_1.ZipEncryptService; } });
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pgp-encrypt.interface.d.ts","sourceRoot":"","sources":["../../../src/pgp-encrypt/pgp-encrypt.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,OAAO,CACL,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,GAAG,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pgp-encrypt.module.d.ts","sourceRoot":"","sources":["../../../src/pgp-encrypt/pgp-encrypt.module.ts"],"names":[],"mappings":"AAGA,qBAIa,gBAAgB;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PgpEncryptModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const pgp_encrypt_service_1 = require("./pgp-encrypt.service");
|
|
7
|
+
let PgpEncryptModule = class PgpEncryptModule {
|
|
8
|
+
};
|
|
9
|
+
exports.PgpEncryptModule = PgpEncryptModule;
|
|
10
|
+
exports.PgpEncryptModule = PgpEncryptModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [pgp_encrypt_service_1.PgpEncryptService],
|
|
13
|
+
exports: [pgp_encrypt_service_1.PgpEncryptService],
|
|
14
|
+
})
|
|
15
|
+
], PgpEncryptModule);
|
|
@@ -3,3 +3,4 @@ export declare class PgpEncryptService implements IPgpEncryptModuleInterface {
|
|
|
3
3
|
encrypt(pgpKey: any, dataToEncrypt: any): Promise<string>;
|
|
4
4
|
decrypt(pgpKey: any, encryptedData: any, passphrase?: string): Promise<string>;
|
|
5
5
|
}
|
|
6
|
+
//# sourceMappingURL=pgp-encrypt.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pgp-encrypt.service.d.ts","sourceRoot":"","sources":["../../../src/pgp-encrypt/pgp-encrypt.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE,qBACa,iBAAkB,YAAW,0BAA0B;IACrD,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBzD,OAAO,CAClB,MAAM,EAAE,GAAG,EACX,aAAa,EAAE,GAAG,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;CAiDnB"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.PgpEncryptService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
10
5
|
const common_1 = require("@nestjs/common");
|
|
11
|
-
const openpgp = require("openpgp");
|
|
6
|
+
const openpgp = tslib_1.__importStar(require("openpgp"));
|
|
12
7
|
let PgpEncryptService = class PgpEncryptService {
|
|
13
8
|
async encrypt(pgpKey, dataToEncrypt) {
|
|
14
9
|
try {
|
|
@@ -39,7 +34,7 @@ let PgpEncryptService = class PgpEncryptService {
|
|
|
39
34
|
},
|
|
40
35
|
};
|
|
41
36
|
let privateKey = openpgpPrivatekey;
|
|
42
|
-
if (
|
|
37
|
+
if (passphrase) {
|
|
43
38
|
decryptKeyOptions.passphrase = passphrase;
|
|
44
39
|
privateKey = await openpgp.decryptKey(decryptKeyOptions);
|
|
45
40
|
}
|
|
@@ -66,8 +61,7 @@ let PgpEncryptService = class PgpEncryptService {
|
|
|
66
61
|
}
|
|
67
62
|
}
|
|
68
63
|
};
|
|
69
|
-
PgpEncryptService =
|
|
64
|
+
exports.PgpEncryptService = PgpEncryptService;
|
|
65
|
+
exports.PgpEncryptService = PgpEncryptService = tslib_1.__decorate([
|
|
70
66
|
(0, common_1.Injectable)()
|
|
71
67
|
], PgpEncryptService);
|
|
72
|
-
exports.PgpEncryptService = PgpEncryptService;
|
|
73
|
-
//# sourceMappingURL=pgp-encrypt.service.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as NodeRSA from 'node-rsa';
|
|
3
2
|
export interface RsaEncryptInterface {
|
|
4
3
|
encrypt(message: NodeRSA.Data, key: NodeRSA.KeyBits, messageEncoding: NodeRSA.Encoding): string;
|
|
5
4
|
decrypt(message: string | Buffer, key: NodeRSA.Key, messageEncoding: NodeRSA.Encoding): string;
|
|
6
5
|
}
|
|
6
|
+
//# sourceMappingURL=rsa-encrypt.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsa-encrypt.interface.d.ts","sourceRoot":"","sources":["../../../src/rsa-encrypt/rsa-encrypt.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,mBAAmB;IAClC,OAAO,CACL,OAAO,EAAE,OAAO,CAAC,IAAI,EACrB,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,eAAe,EAAE,OAAO,CAAC,QAAQ,GAChC,MAAM,CAAC;IAEV,OAAO,CACL,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,eAAe,EAAE,OAAO,CAAC,QAAQ,GAChC,MAAM,CAAC;CACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsa-encrypt.module.d.ts","sourceRoot":"","sources":["../../../src/rsa-encrypt/rsa-encrypt.module.ts"],"names":[],"mappings":"AAGA,qBAIa,gBAAgB;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RsaEncryptModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const rsa_encrypt_service_1 = require("./rsa-encrypt.service");
|
|
7
|
+
let RsaEncryptModule = class RsaEncryptModule {
|
|
8
|
+
};
|
|
9
|
+
exports.RsaEncryptModule = RsaEncryptModule;
|
|
10
|
+
exports.RsaEncryptModule = RsaEncryptModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [rsa_encrypt_service_1.RsaEncryptService],
|
|
13
|
+
exports: [rsa_encrypt_service_1.RsaEncryptService],
|
|
14
|
+
})
|
|
15
|
+
], RsaEncryptModule);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import * as NodeRSA from 'node-rsa';
|
|
1
|
+
import NodeRSA from 'node-rsa';
|
|
3
2
|
import { RsaEncryptInterface } from './rsa-encrypt.interface';
|
|
4
3
|
export declare class RsaEncryptService implements RsaEncryptInterface {
|
|
5
4
|
encrypt(message: NodeRSA.Data, key: NodeRSA.KeyBits, messageEncoding?: NodeRSA.Encoding): string;
|
|
6
5
|
decrypt(message: string | Buffer, key: NodeRSA.Key, messageEncoding?: NodeRSA.Encoding): string;
|
|
7
6
|
}
|
|
7
|
+
//# sourceMappingURL=rsa-encrypt.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsa-encrypt.service.d.ts","sourceRoot":"","sources":["../../../src/rsa-encrypt/rsa-encrypt.service.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBACa,iBAAkB,YAAW,mBAAmB;IACpD,OAAO,CACZ,OAAO,EAAE,OAAO,CAAC,IAAI,EACrB,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,eAAe,GAAE,OAAO,CAAC,QAAmB,GAC3C,MAAM;IAMF,OAAO,CACZ,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,eAAe,GAAE,OAAO,CAAC,QAAmB,GAC3C,MAAM;CAKV"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RsaEncryptService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const node_rsa_1 = tslib_1.__importDefault(require("node-rsa"));
|
|
7
|
+
let RsaEncryptService = class RsaEncryptService {
|
|
8
|
+
encrypt(message, key, messageEncoding = 'base64') {
|
|
9
|
+
const rsa = new node_rsa_1.default(key);
|
|
10
|
+
const encryptedData = rsa.encrypt(message, messageEncoding);
|
|
11
|
+
return encryptedData;
|
|
12
|
+
}
|
|
13
|
+
decrypt(message, key, messageEncoding = 'buffer') {
|
|
14
|
+
const rsa = new node_rsa_1.default(key);
|
|
15
|
+
const decrypt = rsa.decrypt(message, messageEncoding).toString();
|
|
16
|
+
return decrypt;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.RsaEncryptService = RsaEncryptService;
|
|
20
|
+
exports.RsaEncryptService = RsaEncryptService = tslib_1.__decorate([
|
|
21
|
+
(0, common_1.Injectable)()
|
|
22
|
+
], RsaEncryptService);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipencrypt.interface.d.ts","sourceRoot":"","sources":["../../../src/zip-encrypt/zipencrypt.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEtD,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG;IAC1D,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipencrypt.module.d.ts","sourceRoot":"","sources":["../../../src/zip-encrypt/zipencrypt.module.ts"],"names":[],"mappings":"AAGA,qBAIa,gBAAgB;CAAG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZipEncryptModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const zipencrypt_service_1 = require("./zipencrypt.service");
|
|
7
|
+
let ZipEncryptModule = class ZipEncryptModule {
|
|
8
|
+
};
|
|
9
|
+
exports.ZipEncryptModule = ZipEncryptModule;
|
|
10
|
+
exports.ZipEncryptModule = ZipEncryptModule = tslib_1.__decorate([
|
|
11
|
+
(0, common_1.Module)({
|
|
12
|
+
providers: [zipencrypt_service_1.ZipEncryptService],
|
|
13
|
+
exports: [zipencrypt_service_1.ZipEncryptService],
|
|
14
|
+
})
|
|
15
|
+
], ZipEncryptModule);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { encryptionMethodType, FileFormat } from './zipencrypt.interface';
|
|
3
2
|
export declare class ZipEncryptService {
|
|
4
3
|
encryptFiles(files: FileFormat[], password: string, encryptionMethod?: encryptionMethodType): Promise<Buffer | false>;
|
|
5
4
|
}
|
|
5
|
+
//# sourceMappingURL=zipencrypt.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zipencrypt.service.d.ts","sourceRoot":"","sources":["../../../src/zip-encrypt/zipencrypt.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,oBAAoB,EACpB,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC,qBACa,iBAAiB;IACf,YAAY,CACvB,KAAK,EAAE,UAAU,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,GAAE,oBAA8B,GAC/C,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;CA0B3B"}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
3
|
exports.ZipEncryptService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
10
5
|
const common_1 = require("@nestjs/common");
|
|
11
6
|
const archiver_1 = require("archiver");
|
|
12
7
|
const stream_buffers_1 = require("stream-buffers");
|
|
13
8
|
let ZipEncryptService = class ZipEncryptService {
|
|
14
9
|
async encryptFiles(files, password, encryptionMethod = 'zip20') {
|
|
15
10
|
const output = new stream_buffers_1.WritableStreamBuffer({
|
|
16
|
-
initialSize:
|
|
17
|
-
incrementAmount:
|
|
11
|
+
initialSize: 1000,
|
|
12
|
+
incrementAmount: 1000,
|
|
18
13
|
});
|
|
19
14
|
if (!(0, archiver_1.isRegisteredFormat)('zip-encrypted')) {
|
|
20
15
|
(0, archiver_1.registerFormat)('zip-encrypted', require('archiver-zip-encrypted'));
|
|
21
16
|
}
|
|
22
|
-
const archive = (0, archiver_1.create)('zip-encrypted', {
|
|
17
|
+
const archive = (0, archiver_1.create)('zip-encrypted', {
|
|
18
|
+
zlib: { level: 8 },
|
|
19
|
+
encryptionMethod,
|
|
20
|
+
password,
|
|
21
|
+
});
|
|
23
22
|
archive.pipe(output);
|
|
24
23
|
files.map((file) => {
|
|
25
24
|
archive.append(file.content, { name: file.filename });
|
|
@@ -29,8 +28,7 @@ let ZipEncryptService = class ZipEncryptService {
|
|
|
29
28
|
return output.getContents();
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
|
-
ZipEncryptService =
|
|
31
|
+
exports.ZipEncryptService = ZipEncryptService;
|
|
32
|
+
exports.ZipEncryptService = ZipEncryptService = tslib_1.__decorate([
|
|
33
33
|
(0, common_1.Injectable)()
|
|
34
34
|
], ZipEncryptService);
|
|
35
|
-
exports.ZipEncryptService = ZipEncryptService;
|
|
36
|
-
//# sourceMappingURL=zipencrypt.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.9.2"}
|