@sebastienrousseau/crypto-kms 0.0.7
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/LICENSE +8 -0
- package/README.md +320 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +15 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/providers/aws.d.ts +36 -0
- package/dist/providers/aws.d.ts.map +1 -0
- package/dist/providers/aws.js +214 -0
- package/dist/providers/azure.d.ts +29 -0
- package/dist/providers/azure.d.ts.map +1 -0
- package/dist/providers/azure.js +52 -0
- package/dist/providers/gcp.d.ts +31 -0
- package/dist/providers/gcp.d.ts.map +1 -0
- package/dist/providers/gcp.js +53 -0
- package/dist/providers/local.d.ts +30 -0
- package/dist/providers/local.d.ts.map +1 -0
- package/dist/providers/local.js +139 -0
- package/dist/providers/pkcs11.d.ts +53 -0
- package/dist/providers/pkcs11.d.ts.map +1 -0
- package/dist/providers/pkcs11.js +165 -0
- package/dist/providers/vault.d.ts +34 -0
- package/dist/providers/vault.d.ts.map +1 -0
- package/dist/providers/vault.js +63 -0
- package/dist/providers/versioned-key.d.ts +26 -0
- package/dist/providers/versioned-key.d.ts.map +1 -0
- package/dist/providers/versioned-key.js +141 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/package.json +71 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VaultKmsProvider = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
class VaultKmsProvider {
|
|
6
|
+
name = "vault";
|
|
7
|
+
_address;
|
|
8
|
+
_token;
|
|
9
|
+
_mount;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this._address = options.address;
|
|
12
|
+
this._token = options.token;
|
|
13
|
+
this._mount = options.mountPath ?? "transit";
|
|
14
|
+
}
|
|
15
|
+
buildUrl(path) {
|
|
16
|
+
const base = this._address.replace(/\/+$/, "");
|
|
17
|
+
return `${base}/v1/${this._mount}/${path}`;
|
|
18
|
+
}
|
|
19
|
+
buildHeaders() {
|
|
20
|
+
return {
|
|
21
|
+
"X-Vault-Token": this._token,
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
listKeys(_filters) {
|
|
26
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
27
|
+
}
|
|
28
|
+
getKey(_keyId) {
|
|
29
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
30
|
+
}
|
|
31
|
+
createKey(_algorithm, _usage, _metadata) {
|
|
32
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
33
|
+
}
|
|
34
|
+
enableKey(_keyId) {
|
|
35
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
36
|
+
}
|
|
37
|
+
disableKey(_keyId) {
|
|
38
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
39
|
+
}
|
|
40
|
+
scheduleKeyDeletion(_keyId, _pendingWindowDays) {
|
|
41
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
42
|
+
}
|
|
43
|
+
encrypt(_keyId, _plaintext, _context) {
|
|
44
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
45
|
+
}
|
|
46
|
+
decrypt(_keyId, _ciphertext, _context) {
|
|
47
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
48
|
+
}
|
|
49
|
+
sign(_keyId, _data, _algorithm) {
|
|
50
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
51
|
+
}
|
|
52
|
+
verify(_keyId, _data, _signature, _algorithm) {
|
|
53
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
54
|
+
}
|
|
55
|
+
rotateKey(_keyId) {
|
|
56
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
57
|
+
}
|
|
58
|
+
generateDataKey(_keyId, _keySpec) {
|
|
59
|
+
return Promise.reject(new errors_1.KmsError("NOT_IMPLEMENTED", "Not implemented: configure HashiCorp Vault connection"));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.VaultKmsProvider = VaultKmsProvider;
|
|
63
|
+
//# sourceMappingURL=vault.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface KeyVersion {
|
|
2
|
+
readonly version: number;
|
|
3
|
+
readonly createdAt: string;
|
|
4
|
+
material: Uint8Array | undefined;
|
|
5
|
+
readonly publicKey: Uint8Array | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface VersionedKey {
|
|
8
|
+
readonly usage: "encrypt" | "sign" | "wrap";
|
|
9
|
+
readonly versions: KeyVersion[];
|
|
10
|
+
}
|
|
11
|
+
export declare function createVersionedKey(usage: VersionedKey["usage"]): VersionedKey;
|
|
12
|
+
export declare function currentVersion(key: VersionedKey): KeyVersion;
|
|
13
|
+
export declare function rotateVersionedKey(key: VersionedKey): KeyVersion;
|
|
14
|
+
export declare function destroyVersion(key: VersionedKey, version: number, keyId: string): void;
|
|
15
|
+
export declare function canonicalContext(context?: Record<string, string>): Buffer;
|
|
16
|
+
export declare function sealCurrent(key: VersionedKey, plaintext: Uint8Array, context?: Record<string, string>): {
|
|
17
|
+
ciphertext: string;
|
|
18
|
+
version: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function openVersioned(key: VersionedKey, keyId: string, ciphertext: string, context?: Record<string, string>): {
|
|
21
|
+
plaintext: Uint8Array;
|
|
22
|
+
version: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function signCurrent(key: VersionedKey, data: Uint8Array): Uint8Array;
|
|
25
|
+
export declare function verifyAnyVersion(key: VersionedKey, data: Uint8Array, signature: Uint8Array): boolean;
|
|
26
|
+
//# sourceMappingURL=versioned-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioned-key.d.ts","sourceRoot":"","sources":["../../src/providers/versioned-key.ts"],"names":[],"mappings":"AA4CA,MAAM,WAAW,UAAU;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,SAAS,CAAC;CAC5C;AAGD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;CACjC;AAuBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAE7E;AAGD,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAE5D;AAGD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAIhE;AA8BD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,IAAI,CAUN;AASD,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAazE;AAWD,wBAAgB,WAAW,CACzB,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAUzC;AAyBD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/B;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAa5C;AAYD,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAO3E;AAMD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,UAAU,GACpB,OAAO,CAQT"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVersionedKey = createVersionedKey;
|
|
4
|
+
exports.currentVersion = currentVersion;
|
|
5
|
+
exports.rotateVersionedKey = rotateVersionedKey;
|
|
6
|
+
exports.destroyVersion = destroyVersion;
|
|
7
|
+
exports.canonicalContext = canonicalContext;
|
|
8
|
+
exports.sealCurrent = sealCurrent;
|
|
9
|
+
exports.openVersioned = openVersioned;
|
|
10
|
+
exports.signCurrent = signCurrent;
|
|
11
|
+
exports.verifyAnyVersion = verifyAnyVersion;
|
|
12
|
+
const node_crypto_1 = require("node:crypto");
|
|
13
|
+
const crypto_lib_1 = require("@sebastienrousseau/crypto-lib");
|
|
14
|
+
const errors_1 = require("../errors");
|
|
15
|
+
const FORMAT_V1 = 0x01;
|
|
16
|
+
const HEADER_LEN = 5;
|
|
17
|
+
const IV_LEN = 12;
|
|
18
|
+
const TAG_LEN = 16;
|
|
19
|
+
const ED25519_SIG_LEN = 64;
|
|
20
|
+
function newVersion(usage, version) {
|
|
21
|
+
const createdAt = new Date().toISOString();
|
|
22
|
+
if (usage === "sign") {
|
|
23
|
+
const kp = (0, crypto_lib_1.generateEd25519KeyPair)();
|
|
24
|
+
return {
|
|
25
|
+
version,
|
|
26
|
+
createdAt,
|
|
27
|
+
material: (0, crypto_lib_1.hexToBytes)(kp.privateKey),
|
|
28
|
+
publicKey: (0, crypto_lib_1.hexToBytes)(kp.publicKey),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
version,
|
|
33
|
+
createdAt,
|
|
34
|
+
material: (0, node_crypto_1.randomBytes)(32),
|
|
35
|
+
publicKey: undefined,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function createVersionedKey(usage) {
|
|
39
|
+
return { usage, versions: [newVersion(usage, 1)] };
|
|
40
|
+
}
|
|
41
|
+
function currentVersion(key) {
|
|
42
|
+
return key.versions[key.versions.length - 1];
|
|
43
|
+
}
|
|
44
|
+
function rotateVersionedKey(key) {
|
|
45
|
+
const next = newVersion(key.usage, key.versions.length + 1);
|
|
46
|
+
key.versions.push(next);
|
|
47
|
+
return next;
|
|
48
|
+
}
|
|
49
|
+
function materialOf(key, version, keyId) {
|
|
50
|
+
const entry = key.versions[version - 1];
|
|
51
|
+
if (!entry) {
|
|
52
|
+
throw new errors_1.KmsError("NOT_FOUND", `Key version ${version} not found for key ${keyId}`, keyId);
|
|
53
|
+
}
|
|
54
|
+
if (!entry.material) {
|
|
55
|
+
throw new errors_1.KmsError("VERSION_DESTROYED", `Key version ${version} of key ${keyId} has been destroyed`, keyId);
|
|
56
|
+
}
|
|
57
|
+
return entry.material;
|
|
58
|
+
}
|
|
59
|
+
function destroyVersion(key, version, keyId) {
|
|
60
|
+
materialOf(key, version, keyId);
|
|
61
|
+
if (version === currentVersion(key).version) {
|
|
62
|
+
throw new errors_1.KmsError("INVALID_ARGUMENT", `Cannot destroy the current version (${version}) of key ${keyId}; rotate first`, keyId);
|
|
63
|
+
}
|
|
64
|
+
key.versions[version - 1].material = undefined;
|
|
65
|
+
}
|
|
66
|
+
function canonicalContext(context) {
|
|
67
|
+
const entries = Object.entries(context ?? {});
|
|
68
|
+
if (entries.length === 0)
|
|
69
|
+
return Buffer.alloc(0);
|
|
70
|
+
for (const [k, v] of entries) {
|
|
71
|
+
if (typeof v !== "string") {
|
|
72
|
+
throw new errors_1.KmsError("INVALID_ARGUMENT", `Encryption context value for '${k}' must be a string`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
entries.sort(([a], [b]) => (a < b ? -1 : 1));
|
|
76
|
+
return Buffer.from(JSON.stringify(entries), "utf8");
|
|
77
|
+
}
|
|
78
|
+
function header(version) {
|
|
79
|
+
const h = Buffer.alloc(HEADER_LEN);
|
|
80
|
+
h[0] = FORMAT_V1;
|
|
81
|
+
h.writeUInt32BE(version, 1);
|
|
82
|
+
return h;
|
|
83
|
+
}
|
|
84
|
+
function sealCurrent(key, plaintext, context) {
|
|
85
|
+
const aadContext = canonicalContext(context);
|
|
86
|
+
const { version, material } = currentVersion(key);
|
|
87
|
+
const head = header(version);
|
|
88
|
+
const iv = (0, node_crypto_1.randomBytes)(IV_LEN);
|
|
89
|
+
const cipher = (0, node_crypto_1.createCipheriv)("aes-256-gcm", material, iv);
|
|
90
|
+
cipher.setAAD(Buffer.concat([head, aadContext]));
|
|
91
|
+
const body = Buffer.concat([cipher.update(plaintext), cipher.final()]);
|
|
92
|
+
const packed = Buffer.concat([head, iv, cipher.getAuthTag(), body]);
|
|
93
|
+
return { ciphertext: packed.toString("base64"), version };
|
|
94
|
+
}
|
|
95
|
+
function parseEnvelope(ciphertext, keyId) {
|
|
96
|
+
const data = Buffer.from(ciphertext, "base64");
|
|
97
|
+
if (data.length < HEADER_LEN + IV_LEN + TAG_LEN) {
|
|
98
|
+
throw new errors_1.KmsError("INVALID_CIPHERTEXT", "Ciphertext too short", keyId);
|
|
99
|
+
}
|
|
100
|
+
if (data[0] !== FORMAT_V1) {
|
|
101
|
+
throw new errors_1.KmsError("INVALID_CIPHERTEXT", "Unsupported ciphertext format", keyId);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
head: data.subarray(0, HEADER_LEN),
|
|
105
|
+
version: data.readUInt32BE(1),
|
|
106
|
+
iv: data.subarray(HEADER_LEN, HEADER_LEN + IV_LEN),
|
|
107
|
+
tag: data.subarray(HEADER_LEN + IV_LEN, HEADER_LEN + IV_LEN + TAG_LEN),
|
|
108
|
+
body: data.subarray(HEADER_LEN + IV_LEN + TAG_LEN),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function openVersioned(key, keyId, ciphertext, context) {
|
|
112
|
+
const aadContext = canonicalContext(context);
|
|
113
|
+
const env = parseEnvelope(ciphertext, keyId);
|
|
114
|
+
const material = materialOf(key, env.version, keyId);
|
|
115
|
+
const decipher = (0, node_crypto_1.createDecipheriv)("aes-256-gcm", material, env.iv);
|
|
116
|
+
decipher.setAuthTag(env.tag);
|
|
117
|
+
decipher.setAAD(Buffer.concat([env.head, aadContext]));
|
|
118
|
+
try {
|
|
119
|
+
const out = Buffer.concat([decipher.update(env.body), decipher.final()]);
|
|
120
|
+
return { plaintext: new Uint8Array(out), version: env.version };
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
throw new errors_1.KmsError("DECRYPTION_FAILED", "Decryption failed", keyId);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function signedMessage(data) {
|
|
127
|
+
return data;
|
|
128
|
+
}
|
|
129
|
+
function signCurrent(key, data) {
|
|
130
|
+
const { material } = currentVersion(key);
|
|
131
|
+
const { signature } = (0, crypto_lib_1.ed25519Sign)(material, signedMessage(data));
|
|
132
|
+
return (0, crypto_lib_1.hexToBytes)(signature);
|
|
133
|
+
}
|
|
134
|
+
function verifyAnyVersion(key, data, signature) {
|
|
135
|
+
if (signature.length !== ED25519_SIG_LEN)
|
|
136
|
+
return false;
|
|
137
|
+
return key.versions.some((v) => v.material !== undefined &&
|
|
138
|
+
(0, crypto_lib_1.ed25519Verify)(v.publicKey, signedMessage(data), signature)
|
|
139
|
+
.valid);
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=versioned-key.js.map
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface KmsKeyMetadata {
|
|
2
|
+
keyId: string;
|
|
3
|
+
algorithm: string;
|
|
4
|
+
usage: "encrypt" | "sign" | "wrap";
|
|
5
|
+
createdAt: string;
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
provider: string;
|
|
8
|
+
currentVersion?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface KmsEncryptResult {
|
|
11
|
+
ciphertext: string;
|
|
12
|
+
keyId: string;
|
|
13
|
+
context?: Record<string, string>;
|
|
14
|
+
keyVersion?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface KmsDecryptResult {
|
|
17
|
+
plaintext: Uint8Array;
|
|
18
|
+
keyId: string;
|
|
19
|
+
keyVersion?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface KmsSignResult {
|
|
22
|
+
signature: string;
|
|
23
|
+
keyId: string;
|
|
24
|
+
algorithm: string;
|
|
25
|
+
}
|
|
26
|
+
export interface KmsProvider {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
listKeys(filters?: {
|
|
29
|
+
usage?: string;
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
}): Promise<KmsKeyMetadata[]>;
|
|
32
|
+
getKey(keyId: string): Promise<KmsKeyMetadata>;
|
|
33
|
+
createKey(algorithm: string, usage: "encrypt" | "sign" | "wrap", metadata?: Record<string, string>): Promise<KmsKeyMetadata>;
|
|
34
|
+
enableKey(keyId: string): Promise<void>;
|
|
35
|
+
disableKey(keyId: string): Promise<void>;
|
|
36
|
+
scheduleKeyDeletion(keyId: string, pendingWindowDays?: number): Promise<void>;
|
|
37
|
+
encrypt(keyId: string, plaintext: Uint8Array, context?: Record<string, string>): Promise<KmsEncryptResult>;
|
|
38
|
+
decrypt(keyId: string, ciphertext: string, context?: Record<string, string>): Promise<KmsDecryptResult>;
|
|
39
|
+
sign(keyId: string, data: Uint8Array, algorithm?: string): Promise<KmsSignResult>;
|
|
40
|
+
verify(keyId: string, data: Uint8Array, signature: string, algorithm?: string): Promise<boolean>;
|
|
41
|
+
rotateKey(keyId: string): Promise<KmsKeyMetadata>;
|
|
42
|
+
destroyKeyVersion?(keyId: string, version: number): Promise<void>;
|
|
43
|
+
generateDataKey(keyId: string, keySpec?: string): Promise<{
|
|
44
|
+
plaintext: Uint8Array;
|
|
45
|
+
ciphertext: string;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sebastienrousseau/crypto-kms",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "Enterprise key management adapters for AWS KMS, Google Cloud KMS, Azure Key Vault, and HashiCorp Vault.",
|
|
5
|
+
"author": "Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>",
|
|
6
|
+
"license": "MIT OR Apache-2.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.0.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist/**/*.js",
|
|
22
|
+
"dist/**/*.d.ts",
|
|
23
|
+
"dist/**/*.d.ts.map"
|
|
24
|
+
],
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@sebastienrousseau/crypto-lib": "0.0.7"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@aws-sdk/client-kms": "^3.0.0",
|
|
30
|
+
"@azure/keyvault-keys": "^4.0.0",
|
|
31
|
+
"@google-cloud/kms": "^6.2.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@aws-sdk/client-kms": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"@google-cloud/kms": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"@azure/keyvault-keys": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/chai": "^4.3.7",
|
|
46
|
+
"@types/mocha": "^10.0.2",
|
|
47
|
+
"@types/node": "^26.4.1",
|
|
48
|
+
"c8": "^12.0.0",
|
|
49
|
+
"chai": "^4.5.0",
|
|
50
|
+
"mocha": "^10.8.2",
|
|
51
|
+
"rimraf": "^6.1.3",
|
|
52
|
+
"ts-node": "^10.9.2",
|
|
53
|
+
"typedoc": "^0.28.20",
|
|
54
|
+
"typescript": "~5.9.3"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/sebastienrousseau/crypto-service/tree/main/packages/crypto-kms",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"private": false,
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsc --build tsconfig.json",
|
|
63
|
+
"clean": "rimraf ./coverage ./dist ./docs",
|
|
64
|
+
"test": "c8 --check-coverage --lines 100 --branches 100 --functions 100 --reporter=lcov --reporter=text mocha --config=.mocharc.cjs",
|
|
65
|
+
"docs": "typedoc",
|
|
66
|
+
"lint": "eslint --ext .ts src __tests__",
|
|
67
|
+
"lint:fix": "eslint --cache --fix --ext .ts src __tests__",
|
|
68
|
+
"format": "prettier --write src/**/*.ts",
|
|
69
|
+
"format:check": "prettier --check \"src/**/*.ts\""
|
|
70
|
+
}
|
|
71
|
+
}
|