@sebastienrousseau/crypto-lib 0.0.2 → 0.0.3
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 +201 -42
- package/dist/Report.txt +158 -70
- package/dist/bin/cryptolib.d.ts +23 -0
- package/dist/bin/cryptolib.d.ts.map +1 -0
- package/dist/bin/cryptolib.js +78 -0
- package/dist/bin/cryptolib.js.map +1 -0
- package/dist/config/config.d.ts +8 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +13 -0
- package/dist/config/config.js.map +1 -0
- package/dist/data/decrypted.txt +1 -0
- package/dist/data/detached.sig +1 -0
- package/dist/data/encrypted.txt +1 -0
- package/dist/data/signed.sig +1 -0
- package/dist/enums.d.ts +81 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +82 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/key/key.d.ts +17 -0
- package/dist/key/key.d.ts.map +1 -0
- package/dist/key/key.js +19 -0
- package/dist/key/key.js.map +1 -0
- package/dist/key/rsa-reformat.cert +1 -0
- package/dist/key/rsa-reformat.key +1 -0
- package/dist/key/rsa-reformat.pub +1 -0
- package/dist/key/rsa-revoke.key +1 -0
- package/dist/key/rsa-revoke.pub +1 -0
- package/dist/key/rsa.cert +1 -0
- package/dist/key/rsa.key +1 -0
- package/dist/key/rsa.pub +1 -0
- package/dist/lib/decrypt.d.ts +2 -5
- package/dist/lib/decrypt.d.ts.map +1 -1
- package/dist/lib/decrypt.js +38 -20
- package/dist/lib/decrypt.js.map +1 -1
- package/dist/lib/encrypt.d.ts +2 -5
- package/dist/lib/encrypt.d.ts.map +1 -1
- package/dist/lib/encrypt.js +25 -14
- package/dist/lib/encrypt.js.map +1 -1
- package/dist/lib/generate.d.ts +2 -11
- package/dist/lib/generate.d.ts.map +1 -1
- package/dist/lib/generate.js +50 -15
- package/dist/lib/generate.js.map +1 -1
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/{bin/crypto-lib.js → lib/index.js} +18 -27
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/reformat.d.ts +4 -0
- package/dist/lib/reformat.d.ts.map +1 -0
- package/dist/lib/reformat.js +91 -0
- package/dist/lib/reformat.js.map +1 -0
- package/dist/lib/revoke.d.ts +3 -3
- package/dist/lib/revoke.d.ts.map +1 -1
- package/dist/lib/revoke.js +35 -10
- package/dist/lib/revoke.js.map +1 -1
- package/dist/lib/session.d.ts +5 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/session.js +70 -0
- package/dist/lib/session.js.map +1 -0
- package/dist/lib/sign.d.ts +4 -0
- package/dist/lib/sign.d.ts.map +1 -0
- package/dist/lib/sign.js +70 -0
- package/dist/lib/sign.js.map +1 -0
- package/dist/lib/verify.d.ts +7 -0
- package/dist/lib/verify.d.ts.map +1 -0
- package/dist/lib/verify.js +57 -0
- package/dist/lib/verify.js.map +1 -0
- package/dist/package.json +37 -25
- package/dist/types/types.d.ts +49 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -0
- package/package.json +37 -25
- package/dist/bin/crypto-lib.d.ts +0 -13
- package/dist/bin/crypto-lib.d.ts.map +0 -1
- package/dist/bin/crypto-lib.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.verify = void 0;
|
|
27
|
+
const fs_1 = require("fs");
|
|
28
|
+
const openpgp = __importStar(require("openpgp"));
|
|
29
|
+
const args = process.argv.slice(2);
|
|
30
|
+
const verify = async (data) => {
|
|
31
|
+
const message = data.message;
|
|
32
|
+
const detachedSignatureBase64 = (0, fs_1.readFileSync)(process.cwd() + "/src/data/detached.sig");
|
|
33
|
+
const detachedSignature = Buffer.from(detachedSignatureBase64.toString(), "base64").toString("utf-8");
|
|
34
|
+
const publicKey = Buffer.from(data.publicKey.toString(), "base64").toString("utf-8");
|
|
35
|
+
const signature = await openpgp.readSignature({
|
|
36
|
+
armoredSignature: String(detachedSignature),
|
|
37
|
+
});
|
|
38
|
+
const verified = await openpgp.verify({
|
|
39
|
+
message: await openpgp.createMessage({ text: message }),
|
|
40
|
+
signature,
|
|
41
|
+
verificationKeys: await openpgp.readKey({
|
|
42
|
+
armoredKey: publicKey,
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
console.log(verified);
|
|
46
|
+
return verified;
|
|
47
|
+
};
|
|
48
|
+
exports.verify = verify;
|
|
49
|
+
if (args instanceof Array && args.length) {
|
|
50
|
+
const data = {
|
|
51
|
+
message: args[1],
|
|
52
|
+
publicKey: args[3],
|
|
53
|
+
};
|
|
54
|
+
(0, exports.verify)(data);
|
|
55
|
+
}
|
|
56
|
+
exports.default = exports.verify;
|
|
57
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/lib/verify.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAAkC;AAClC,iDAAmC;AAGnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAe5B,MAAM,MAAM,GAAG,KAAK,EAAE,IAAsB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,MAAM,uBAAuB,GAAG,IAAA,iBAAY,EAC1C,OAAO,CAAC,GAAG,EAAE,GAAG,wBAAwB,CACzC,CAAC;IACF,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CACnC,uBAAuB,CAAC,QAAQ,EAAE,EAClC,QAAQ,CACT,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpB,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,QAAQ,CACzE,OAAO,CACR,CAAC;IAEF,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC;QAC5C,gBAAgB,EAAE,MAAM,CAAC,iBAAiB,CAAC;KAC5C,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;QACpC,OAAO,EAAE,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACvD,SAAS;QACT,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC;YACtC,UAAU,EAAE,SAAS;SACtB,CAAC;KACH,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtB,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA1BW,QAAA,MAAM,UA0BjB;AAEF,IAAI,IAAI,YAAY,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;IACxC,MAAM,IAAI,GAAG;QACX,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;KACnB,CAAC;IACF,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;CACd;AAED,kBAAe,cAAM,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"author": "Sebastien Rousseau <
|
|
2
|
+
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
3
3
|
"autoupdate": {
|
|
4
4
|
"fileMap": [
|
|
5
5
|
{
|
|
@@ -13,51 +13,61 @@
|
|
|
13
13
|
"target": "git://github.com/sebastienrousseau/crypto-service.git"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
|
-
"
|
|
16
|
+
"cryptolib": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/sebastienrousseau/crypto-service/issues"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"openpgp": "^
|
|
22
|
+
"@types/openpgp": "^4.4.18",
|
|
23
|
+
"openpgp": "^5.3.1"
|
|
23
24
|
},
|
|
24
25
|
"description": "Crypto Lib is a powerful intuitive cryptographic JavaScript library that encapsulates common algorithms, functions and provides an interface for low-level cryptographic operations.",
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@sebastienrousseau/c8-config": "^0.0.
|
|
27
|
+
"@sebastienrousseau/c8-config": "^0.0.3",
|
|
27
28
|
"@sebastienrousseau/eslint-config": "^0.0.2",
|
|
28
29
|
"@sebastienrousseau/jsdoc-config": "^0.0.5",
|
|
29
30
|
"@sebastienrousseau/markdownlint-config": "^0.0.1",
|
|
30
|
-
"@sebastienrousseau/mocha-config": "^0.0.
|
|
31
|
+
"@sebastienrousseau/mocha-config": "^0.0.5",
|
|
31
32
|
"@sebastienrousseau/prettier-config": "^0.0.4",
|
|
32
33
|
"@sebastienrousseau/remark-config": "^0.0.3",
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
34
|
+
"@types/chai": "^4.3.1",
|
|
35
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
36
|
+
"@types/compression": "^1.7.2",
|
|
37
|
+
"@types/mocha": "^9.1.1",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
39
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
35
40
|
"c8": "^7.11.3",
|
|
36
41
|
"chai": "^4.3.6",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
42
|
+
"chai-as-promised": "^7.1.1",
|
|
43
|
+
"compression": "^1.7.4",
|
|
44
|
+
"coveralls": "^3.1.1",
|
|
45
|
+
"eslint": "^8.19.0",
|
|
46
|
+
"eslint-import-resolver-typescript": "^3.2.4",
|
|
47
|
+
"eslint-plugin-import": "^2.26.0",
|
|
39
48
|
"filesizes": "^0.1.2",
|
|
40
|
-
"minami": "^1.2.3",
|
|
41
49
|
"mocha": "^10.0.0",
|
|
42
|
-
"prettier": "^2.
|
|
43
|
-
"remark-cli": "^
|
|
50
|
+
"prettier": "^2.7.1",
|
|
51
|
+
"remark-cli": "^11.0.0",
|
|
44
52
|
"remark-footnotes": "^4.0.1",
|
|
45
53
|
"remark-preset-lint-consistent": "^5.1.1",
|
|
46
54
|
"remark-preset-lint-markdown-style-guide": "^5.1.2",
|
|
47
55
|
"remark-preset-lint-recommended": "^6.1.2",
|
|
48
56
|
"rimraf": "^3.0.2",
|
|
49
|
-
"
|
|
50
|
-
"typedoc
|
|
51
|
-
"
|
|
57
|
+
"ts-node": "^10.8.2",
|
|
58
|
+
"typedoc": "^0.23.5",
|
|
59
|
+
"typedoc-plugin-missing-exports": "^0.23.0",
|
|
60
|
+
"typescript": "^4.7.4"
|
|
52
61
|
},
|
|
53
62
|
"directories": {
|
|
54
|
-
|
|
63
|
+
"src": "./src",
|
|
64
|
+
"test": "__tests__"
|
|
55
65
|
},
|
|
56
66
|
"engines": {
|
|
57
67
|
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
58
68
|
},
|
|
59
69
|
"files": [
|
|
60
|
-
|
|
70
|
+
"dist/"
|
|
61
71
|
],
|
|
62
72
|
"funding": [
|
|
63
73
|
{
|
|
@@ -106,26 +116,28 @@
|
|
|
106
116
|
"url": "git@github.com:sebastienrousseau/crypto-service.git"
|
|
107
117
|
},
|
|
108
118
|
"scripts": {
|
|
109
|
-
"build": "tsc
|
|
110
|
-
"clean": "rimraf ./dist ./docs ./node_modules
|
|
111
|
-
"copy:package": "cp ./package.json ./dist/",
|
|
119
|
+
"build": "tsc --build tsconfig.json && yarn run copy:makefile && yarn copy:package && yarn run copy:key && yarn run copy:data && yarn run copy:copyright && yarn run filesize:distribution",
|
|
120
|
+
"clean": "rimraf ./coverage ./dist ./docs ./node_modules",
|
|
112
121
|
"copy:copyright": "cp COPYRIGHT dist/",
|
|
122
|
+
"copy:data": "mkdirp dist/data && cp -fr src/data/*.txt dist/data/ && cp -fr src/data/*.sig dist/data/",
|
|
123
|
+
"copy:key": "cp src/key/*.pub dist/key/ && cp src/key/*.key dist/key/ && cp src/key/*.cert dist/key/",
|
|
113
124
|
"copy:license": "cp LICENSE dist/",
|
|
114
125
|
"copy:makefile": "cp Makefile dist/",
|
|
126
|
+
"copy:package": "cp ./package.json ./dist/",
|
|
115
127
|
"copy:readme": "cp README.md dist/",
|
|
116
128
|
"docs": "typedoc",
|
|
117
|
-
"fix": "eslint --fix src/**/*.ts",
|
|
118
129
|
"filesize:distribution": "filesizes dist/ > dist/Report.txt",
|
|
130
|
+
"lint:fix": "eslint --cache --fix src/**/*.ts",
|
|
119
131
|
"lint": "eslint src/**/*.ts",
|
|
120
132
|
"markdown": "yarn remark ./*.md packages/**/*.md --rc-path ./.remarkrc --quiet",
|
|
121
133
|
"prepack": "yarn build",
|
|
122
|
-
"
|
|
134
|
+
"format": "prettier --write src/**/*.ts",
|
|
135
|
+
"release": "yarn release:prepare && yarn release:publish",
|
|
123
136
|
"release:prepare": "yarn pack",
|
|
124
137
|
"release:publish": "yarn publish --access public --ignore-scripts --@OWNER:registry='https://registry.npmjs.org' && npm publish",
|
|
125
|
-
"release": "yarn release:prepare && yarn release:publish",
|
|
126
138
|
"start": "node dist/index.js",
|
|
127
|
-
"test": "c8 --config=.c8rc mocha --config=.mocharc"
|
|
139
|
+
"test": "npx c8 --config=.c8rc --reporter=lcov mocha --config=.mocharc"
|
|
128
140
|
},
|
|
129
141
|
"types": "./dist/index.d.ts",
|
|
130
|
-
"version": "0.0.
|
|
142
|
+
"version": "0.0.3"
|
|
131
143
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1 +1,50 @@
|
|
|
1
|
+
export declare type dataGenerate = {
|
|
2
|
+
curve: any;
|
|
3
|
+
date: Date;
|
|
4
|
+
email: string;
|
|
5
|
+
format: any;
|
|
6
|
+
keyExpirationTime: number;
|
|
7
|
+
name: string;
|
|
8
|
+
passphrase: string;
|
|
9
|
+
rsaBits: number;
|
|
10
|
+
type: any;
|
|
11
|
+
userIDs: any;
|
|
12
|
+
};
|
|
13
|
+
export declare type dataRevoke = {
|
|
14
|
+
passphrase: string;
|
|
15
|
+
flag: number;
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
export declare type dataEncrypt = {
|
|
19
|
+
passphrase: string;
|
|
20
|
+
message: string;
|
|
21
|
+
publicKey: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type dataDecrypt = {
|
|
24
|
+
passphrase: string;
|
|
25
|
+
encryptedMessage: string;
|
|
26
|
+
publicKey: string;
|
|
27
|
+
};
|
|
28
|
+
export declare type dataSign = {
|
|
29
|
+
message: string;
|
|
30
|
+
detached: boolean;
|
|
31
|
+
passphrase: string;
|
|
32
|
+
};
|
|
33
|
+
export declare type dataVerify = {
|
|
34
|
+
message: string;
|
|
35
|
+
publicKey: string;
|
|
36
|
+
};
|
|
37
|
+
export declare type dataSessionKey = {
|
|
38
|
+
email: string;
|
|
39
|
+
name: string;
|
|
40
|
+
publicKey: string;
|
|
41
|
+
};
|
|
42
|
+
export declare type dataReformat = {
|
|
43
|
+
date: Date;
|
|
44
|
+
email: string;
|
|
45
|
+
expiration: number;
|
|
46
|
+
name: string;
|
|
47
|
+
passphrase: string;
|
|
48
|
+
publicKey: string;
|
|
49
|
+
};
|
|
1
50
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAoBA,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,GAAG,CAAC;CACd,CAAC;AAmBF,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAcF,oBAAY,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAcF,oBAAY,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAcF,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAaF,oBAAY,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAcF,oBAAY,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
package/dist/types/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"author": "Sebastien Rousseau <
|
|
2
|
+
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
3
3
|
"autoupdate": {
|
|
4
4
|
"fileMap": [
|
|
5
5
|
{
|
|
@@ -13,51 +13,61 @@
|
|
|
13
13
|
"target": "git://github.com/sebastienrousseau/crypto-service.git"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
|
-
"
|
|
16
|
+
"cryptolib": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/sebastienrousseau/crypto-service/issues"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"openpgp": "^
|
|
22
|
+
"@types/openpgp": "^4.4.18",
|
|
23
|
+
"openpgp": "^5.3.1"
|
|
23
24
|
},
|
|
24
25
|
"description": "Crypto Lib is a powerful intuitive cryptographic JavaScript library that encapsulates common algorithms, functions and provides an interface for low-level cryptographic operations.",
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@sebastienrousseau/c8-config": "^0.0.
|
|
27
|
+
"@sebastienrousseau/c8-config": "^0.0.3",
|
|
27
28
|
"@sebastienrousseau/eslint-config": "^0.0.2",
|
|
28
29
|
"@sebastienrousseau/jsdoc-config": "^0.0.5",
|
|
29
30
|
"@sebastienrousseau/markdownlint-config": "^0.0.1",
|
|
30
|
-
"@sebastienrousseau/mocha-config": "^0.0.
|
|
31
|
+
"@sebastienrousseau/mocha-config": "^0.0.5",
|
|
31
32
|
"@sebastienrousseau/prettier-config": "^0.0.4",
|
|
32
33
|
"@sebastienrousseau/remark-config": "^0.0.3",
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
34
|
+
"@types/chai": "^4.3.1",
|
|
35
|
+
"@types/chai-as-promised": "^7.1.5",
|
|
36
|
+
"@types/compression": "^1.7.2",
|
|
37
|
+
"@types/mocha": "^9.1.1",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
39
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
35
40
|
"c8": "^7.11.3",
|
|
36
41
|
"chai": "^4.3.6",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
42
|
+
"chai-as-promised": "^7.1.1",
|
|
43
|
+
"compression": "^1.7.4",
|
|
44
|
+
"coveralls": "^3.1.1",
|
|
45
|
+
"eslint": "^8.19.0",
|
|
46
|
+
"eslint-import-resolver-typescript": "^3.2.4",
|
|
47
|
+
"eslint-plugin-import": "^2.26.0",
|
|
39
48
|
"filesizes": "^0.1.2",
|
|
40
|
-
"minami": "^1.2.3",
|
|
41
49
|
"mocha": "^10.0.0",
|
|
42
|
-
"prettier": "^2.
|
|
43
|
-
"remark-cli": "^
|
|
50
|
+
"prettier": "^2.7.1",
|
|
51
|
+
"remark-cli": "^11.0.0",
|
|
44
52
|
"remark-footnotes": "^4.0.1",
|
|
45
53
|
"remark-preset-lint-consistent": "^5.1.1",
|
|
46
54
|
"remark-preset-lint-markdown-style-guide": "^5.1.2",
|
|
47
55
|
"remark-preset-lint-recommended": "^6.1.2",
|
|
48
56
|
"rimraf": "^3.0.2",
|
|
49
|
-
"
|
|
50
|
-
"typedoc
|
|
51
|
-
"
|
|
57
|
+
"ts-node": "^10.8.2",
|
|
58
|
+
"typedoc": "^0.23.5",
|
|
59
|
+
"typedoc-plugin-missing-exports": "^0.23.0",
|
|
60
|
+
"typescript": "^4.7.4"
|
|
52
61
|
},
|
|
53
62
|
"directories": {
|
|
54
|
-
|
|
63
|
+
"src": "./src",
|
|
64
|
+
"test": "__tests__"
|
|
55
65
|
},
|
|
56
66
|
"engines": {
|
|
57
67
|
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
58
68
|
},
|
|
59
69
|
"files": [
|
|
60
|
-
|
|
70
|
+
"dist/"
|
|
61
71
|
],
|
|
62
72
|
"funding": [
|
|
63
73
|
{
|
|
@@ -106,26 +116,28 @@
|
|
|
106
116
|
"url": "git@github.com:sebastienrousseau/crypto-service.git"
|
|
107
117
|
},
|
|
108
118
|
"scripts": {
|
|
109
|
-
"build": "tsc
|
|
110
|
-
"clean": "rimraf ./dist ./docs ./node_modules
|
|
111
|
-
"copy:package": "cp ./package.json ./dist/",
|
|
119
|
+
"build": "tsc --build tsconfig.json && yarn run copy:makefile && yarn copy:package && yarn run copy:key && yarn run copy:data && yarn run copy:copyright && yarn run filesize:distribution",
|
|
120
|
+
"clean": "rimraf ./coverage ./dist ./docs ./node_modules",
|
|
112
121
|
"copy:copyright": "cp COPYRIGHT dist/",
|
|
122
|
+
"copy:data": "mkdirp dist/data && cp -fr src/data/*.txt dist/data/ && cp -fr src/data/*.sig dist/data/",
|
|
123
|
+
"copy:key": "cp src/key/*.pub dist/key/ && cp src/key/*.key dist/key/ && cp src/key/*.cert dist/key/",
|
|
113
124
|
"copy:license": "cp LICENSE dist/",
|
|
114
125
|
"copy:makefile": "cp Makefile dist/",
|
|
126
|
+
"copy:package": "cp ./package.json ./dist/",
|
|
115
127
|
"copy:readme": "cp README.md dist/",
|
|
116
128
|
"docs": "typedoc",
|
|
117
|
-
"fix": "eslint --fix src/**/*.ts",
|
|
118
129
|
"filesize:distribution": "filesizes dist/ > dist/Report.txt",
|
|
130
|
+
"lint:fix": "eslint --cache --fix src/**/*.ts",
|
|
119
131
|
"lint": "eslint src/**/*.ts",
|
|
120
132
|
"markdown": "yarn remark ./*.md packages/**/*.md --rc-path ./.remarkrc --quiet",
|
|
121
133
|
"prepack": "yarn build",
|
|
122
|
-
"
|
|
134
|
+
"format": "prettier --write src/**/*.ts",
|
|
135
|
+
"release": "yarn release:prepare && yarn release:publish",
|
|
123
136
|
"release:prepare": "yarn pack",
|
|
124
137
|
"release:publish": "yarn publish --access public --ignore-scripts --@OWNER:registry='https://registry.npmjs.org' && npm publish",
|
|
125
|
-
"release": "yarn release:prepare && yarn release:publish",
|
|
126
138
|
"start": "node dist/index.js",
|
|
127
|
-
"test": "c8 --config=.c8rc mocha --config=.mocharc"
|
|
139
|
+
"test": "npx c8 --config=.c8rc --reporter=lcov mocha --config=.mocharc"
|
|
128
140
|
},
|
|
129
141
|
"types": "./dist/index.d.ts",
|
|
130
|
-
"version": "0.0.
|
|
142
|
+
"version": "0.0.3"
|
|
131
143
|
}
|
package/dist/bin/crypto-lib.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const cryptoLib: (data: {
|
|
2
|
-
bits?: string;
|
|
3
|
-
curve?: string;
|
|
4
|
-
email?: string;
|
|
5
|
-
expiration?: string;
|
|
6
|
-
format?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
passphrase?: string;
|
|
9
|
-
sign?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
}) => Promise<void>;
|
|
12
|
-
export default cryptoLib;
|
|
13
|
-
//# sourceMappingURL=crypto-lib.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-lib.d.ts","sourceRoot":"","sources":["../../src/bin/crypto-lib.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,SAAS,SAAgB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,kBASA,CAAC;AAmBF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-lib.js","sourceRoot":"","sources":["../../src/bin/crypto-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAQnC,MAAM,SAAS,GAAG,KAAK,EAAE,IAUxB,EAAE,EAAE;IACH,IAAI,IAAI,CAAC,IAAI,EAAE;QACb,IAAI,cAAc,GAAG,iBAAiB,CAAC;QACvC,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;YACrB,cAAc,GAAG,wDAAa,cAAc,GAAC,CAAC;YAC9C,cAAc,CAAC;QACjB,CAAC,CAAC;QACF,GAAG,EAAE,CAAC;KACP;AACH,CAAC,CAAC;AAIF,IAAI,IAAI,YAAY,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;IACxC,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACd,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QACd,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QACd,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QAChB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACb,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QACnB,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACd,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;KACd,CAAC;IACF,SAAS,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,kBAAe,SAAS,CAAC"}
|