@credo-ts/askar 0.4.1-alpha.157
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 +202 -0
- package/README.md +31 -0
- package/build/AskarModule.d.ts +9 -0
- package/build/AskarModule.js +58 -0
- package/build/AskarModule.js.map +1 -0
- package/build/AskarModuleConfig.d.ts +68 -0
- package/build/AskarModuleConfig.js +33 -0
- package/build/AskarModuleConfig.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +16 -0
- package/build/index.js.map +1 -0
- package/build/storage/AskarStorageService.d.ts +17 -0
- package/build/storage/AskarStorageService.js +139 -0
- package/build/storage/AskarStorageService.js.map +1 -0
- package/build/storage/index.d.ts +1 -0
- package/build/storage/index.js +18 -0
- package/build/storage/index.js.map +1 -0
- package/build/storage/utils.d.ts +15 -0
- package/build/storage/utils.js +110 -0
- package/build/storage/utils.js.map +1 -0
- package/build/utils/askarError.d.ts +14 -0
- package/build/utils/askarError.js +20 -0
- package/build/utils/askarError.js.map +1 -0
- package/build/utils/askarKeyTypes.d.ts +7 -0
- package/build/utils/askarKeyTypes.js +45 -0
- package/build/utils/askarKeyTypes.js.map +1 -0
- package/build/utils/askarWalletConfig.d.ts +14 -0
- package/build/utils/askarWalletConfig.js +75 -0
- package/build/utils/askarWalletConfig.js.map +1 -0
- package/build/utils/assertAskarWallet.d.ts +3 -0
- package/build/utils/assertAskarWallet.js +15 -0
- package/build/utils/assertAskarWallet.js.map +1 -0
- package/build/utils/index.d.ts +3 -0
- package/build/utils/index.js +20 -0
- package/build/utils/index.js.map +1 -0
- package/build/wallet/AskarBaseWallet.d.ts +89 -0
- package/build/wallet/AskarBaseWallet.js +385 -0
- package/build/wallet/AskarBaseWallet.js.map +1 -0
- package/build/wallet/AskarProfileWallet.d.ts +24 -0
- package/build/wallet/AskarProfileWallet.js +150 -0
- package/build/wallet/AskarProfileWallet.js.map +1 -0
- package/build/wallet/AskarWallet.d.ts +58 -0
- package/build/wallet/AskarWallet.js +342 -0
- package/build/wallet/AskarWallet.js.map +1 -0
- package/build/wallet/AskarWalletStorageConfig.d.ts +31 -0
- package/build/wallet/AskarWalletStorageConfig.js +12 -0
- package/build/wallet/AskarWalletStorageConfig.js.map +1 -0
- package/build/wallet/JweEnvelope.d.ts +32 -0
- package/build/wallet/JweEnvelope.js +55 -0
- package/build/wallet/JweEnvelope.js.map +1 -0
- package/build/wallet/didcommV1.d.ts +8 -0
- package/build/wallet/didcommV1.js +156 -0
- package/build/wallet/didcommV1.js.map +1 -0
- package/build/wallet/index.d.ts +3 -0
- package/build/wallet/index.js +23 -0
- package/build/wallet/index.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.didcommV1Unpack = exports.didcommV1Pack = void 0;
|
|
4
|
+
const core_1 = require("@credo-ts/core");
|
|
5
|
+
const aries_askar_shared_1 = require("@hyperledger/aries-askar-shared");
|
|
6
|
+
const JweEnvelope_1 = require("./JweEnvelope");
|
|
7
|
+
function didcommV1Pack(payload, recipientKeys, senderKey) {
|
|
8
|
+
let cek;
|
|
9
|
+
let senderExchangeKey;
|
|
10
|
+
try {
|
|
11
|
+
cek = aries_askar_shared_1.Key.generate(aries_askar_shared_1.KeyAlgs.Chacha20C20P);
|
|
12
|
+
senderExchangeKey = senderKey ? senderKey.convertkey({ algorithm: aries_askar_shared_1.KeyAlgs.X25519 }) : undefined;
|
|
13
|
+
const recipients = [];
|
|
14
|
+
for (const recipientKey of recipientKeys) {
|
|
15
|
+
let targetExchangeKey;
|
|
16
|
+
try {
|
|
17
|
+
targetExchangeKey = aries_askar_shared_1.Key.fromPublicBytes({
|
|
18
|
+
publicKey: core_1.Key.fromPublicKeyBase58(recipientKey, core_1.KeyType.Ed25519).publicKey,
|
|
19
|
+
algorithm: aries_askar_shared_1.KeyAlgs.Ed25519,
|
|
20
|
+
}).convertkey({ algorithm: aries_askar_shared_1.KeyAlgs.X25519 });
|
|
21
|
+
if (senderKey && senderExchangeKey) {
|
|
22
|
+
const encryptedSender = aries_askar_shared_1.CryptoBox.seal({
|
|
23
|
+
recipientKey: targetExchangeKey,
|
|
24
|
+
message: core_1.TypedArrayEncoder.fromString(core_1.TypedArrayEncoder.toBase58(senderKey.publicBytes)),
|
|
25
|
+
});
|
|
26
|
+
const nonce = aries_askar_shared_1.CryptoBox.randomNonce();
|
|
27
|
+
const encryptedCek = aries_askar_shared_1.CryptoBox.cryptoBox({
|
|
28
|
+
recipientKey: targetExchangeKey,
|
|
29
|
+
senderKey: senderExchangeKey,
|
|
30
|
+
message: cek.secretBytes,
|
|
31
|
+
nonce,
|
|
32
|
+
});
|
|
33
|
+
recipients.push(new JweEnvelope_1.JweRecipient({
|
|
34
|
+
encryptedKey: encryptedCek,
|
|
35
|
+
header: {
|
|
36
|
+
kid: recipientKey,
|
|
37
|
+
sender: core_1.TypedArrayEncoder.toBase64URL(encryptedSender),
|
|
38
|
+
iv: core_1.TypedArrayEncoder.toBase64URL(nonce),
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const encryptedCek = aries_askar_shared_1.CryptoBox.seal({
|
|
44
|
+
recipientKey: targetExchangeKey,
|
|
45
|
+
message: cek.secretBytes,
|
|
46
|
+
});
|
|
47
|
+
recipients.push(new JweEnvelope_1.JweRecipient({
|
|
48
|
+
encryptedKey: encryptedCek,
|
|
49
|
+
header: {
|
|
50
|
+
kid: recipientKey,
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
targetExchangeKey === null || targetExchangeKey === void 0 ? void 0 : targetExchangeKey.handle.free();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const protectedJson = {
|
|
60
|
+
enc: 'xchacha20poly1305_ietf',
|
|
61
|
+
typ: 'JWM/1.0',
|
|
62
|
+
alg: senderKey ? 'Authcrypt' : 'Anoncrypt',
|
|
63
|
+
recipients: recipients.map((item) => core_1.JsonTransformer.toJSON(item)),
|
|
64
|
+
};
|
|
65
|
+
const { ciphertext, tag, nonce } = cek.aeadEncrypt({
|
|
66
|
+
message: core_1.Buffer.from(JSON.stringify(payload)),
|
|
67
|
+
aad: core_1.Buffer.from(core_1.JsonEncoder.toBase64URL(protectedJson)),
|
|
68
|
+
}).parts;
|
|
69
|
+
const envelope = new JweEnvelope_1.JweEnvelope({
|
|
70
|
+
ciphertext: core_1.TypedArrayEncoder.toBase64URL(ciphertext),
|
|
71
|
+
iv: core_1.TypedArrayEncoder.toBase64URL(nonce),
|
|
72
|
+
protected: core_1.JsonEncoder.toBase64URL(protectedJson),
|
|
73
|
+
tag: core_1.TypedArrayEncoder.toBase64URL(tag),
|
|
74
|
+
}).toJson();
|
|
75
|
+
return envelope;
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
cek === null || cek === void 0 ? void 0 : cek.handle.free();
|
|
79
|
+
senderExchangeKey === null || senderExchangeKey === void 0 ? void 0 : senderExchangeKey.handle.free();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.didcommV1Pack = didcommV1Pack;
|
|
83
|
+
function didcommV1Unpack(messagePackage, recipientKey) {
|
|
84
|
+
const protectedJson = core_1.JsonEncoder.fromBase64(messagePackage.protected);
|
|
85
|
+
const alg = protectedJson.alg;
|
|
86
|
+
if (!['Anoncrypt', 'Authcrypt'].includes(alg)) {
|
|
87
|
+
throw new core_1.WalletError(`Unsupported pack algorithm: ${alg}`);
|
|
88
|
+
}
|
|
89
|
+
const recipient = protectedJson.recipients.find(
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
+
(r) => r.header.kid === core_1.TypedArrayEncoder.toBase58(recipientKey.publicBytes));
|
|
92
|
+
if (!recipient) {
|
|
93
|
+
throw new core_1.WalletError('No corresponding recipient key found');
|
|
94
|
+
}
|
|
95
|
+
const sender = (recipient === null || recipient === void 0 ? void 0 : recipient.header.sender) ? core_1.TypedArrayEncoder.fromBase64(recipient.header.sender) : undefined;
|
|
96
|
+
const iv = (recipient === null || recipient === void 0 ? void 0 : recipient.header.iv) ? core_1.TypedArrayEncoder.fromBase64(recipient.header.iv) : undefined;
|
|
97
|
+
const encrypted_key = core_1.TypedArrayEncoder.fromBase64(recipient.encrypted_key);
|
|
98
|
+
if (sender && !iv) {
|
|
99
|
+
throw new core_1.WalletError('Missing IV');
|
|
100
|
+
}
|
|
101
|
+
else if (!sender && iv) {
|
|
102
|
+
throw new core_1.WalletError('Unexpected IV');
|
|
103
|
+
}
|
|
104
|
+
let payloadKey, senderKey;
|
|
105
|
+
let sender_x;
|
|
106
|
+
let recip_x;
|
|
107
|
+
try {
|
|
108
|
+
recip_x = recipientKey.convertkey({ algorithm: aries_askar_shared_1.KeyAlgs.X25519 });
|
|
109
|
+
if (sender && iv) {
|
|
110
|
+
senderKey = core_1.TypedArrayEncoder.toUtf8String(aries_askar_shared_1.CryptoBox.sealOpen({
|
|
111
|
+
recipientKey: recip_x,
|
|
112
|
+
ciphertext: sender,
|
|
113
|
+
}));
|
|
114
|
+
sender_x = aries_askar_shared_1.Key.fromPublicBytes({
|
|
115
|
+
algorithm: aries_askar_shared_1.KeyAlgs.Ed25519,
|
|
116
|
+
publicKey: core_1.TypedArrayEncoder.fromBase58(senderKey),
|
|
117
|
+
}).convertkey({ algorithm: aries_askar_shared_1.KeyAlgs.X25519 });
|
|
118
|
+
payloadKey = aries_askar_shared_1.CryptoBox.open({
|
|
119
|
+
recipientKey: recip_x,
|
|
120
|
+
senderKey: sender_x,
|
|
121
|
+
message: encrypted_key,
|
|
122
|
+
nonce: iv,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
payloadKey = aries_askar_shared_1.CryptoBox.sealOpen({ ciphertext: encrypted_key, recipientKey: recip_x });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
sender_x === null || sender_x === void 0 ? void 0 : sender_x.handle.free();
|
|
131
|
+
recip_x === null || recip_x === void 0 ? void 0 : recip_x.handle.free();
|
|
132
|
+
}
|
|
133
|
+
if (!senderKey && alg === 'Authcrypt') {
|
|
134
|
+
throw new core_1.WalletError('Sender public key not provided for Authcrypt');
|
|
135
|
+
}
|
|
136
|
+
let cek;
|
|
137
|
+
try {
|
|
138
|
+
cek = aries_askar_shared_1.Key.fromSecretBytes({ algorithm: aries_askar_shared_1.KeyAlgs.Chacha20C20P, secretKey: payloadKey });
|
|
139
|
+
const message = cek.aeadDecrypt({
|
|
140
|
+
ciphertext: core_1.TypedArrayEncoder.fromBase64(messagePackage.ciphertext),
|
|
141
|
+
nonce: core_1.TypedArrayEncoder.fromBase64(messagePackage.iv),
|
|
142
|
+
tag: core_1.TypedArrayEncoder.fromBase64(messagePackage.tag),
|
|
143
|
+
aad: core_1.TypedArrayEncoder.fromString(messagePackage.protected),
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
plaintextMessage: core_1.JsonEncoder.fromBuffer(message),
|
|
147
|
+
senderKey,
|
|
148
|
+
recipientKey: core_1.TypedArrayEncoder.toBase58(recipientKey.publicBytes),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
cek === null || cek === void 0 ? void 0 : cek.handle.free();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.didcommV1Unpack = didcommV1Unpack;
|
|
156
|
+
//# sourceMappingURL=didcommV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"didcommV1.js","sourceRoot":"","sources":["../../src/wallet/didcommV1.ts"],"names":[],"mappings":";;;AAEA,yCAAmH;AACnH,wEAAqF;AAErF,+CAAyD;AAEzD,SAAgB,aAAa,CAAC,OAAgC,EAAE,aAAuB,EAAE,SAAoB;IAC3G,IAAI,GAAyB,CAAA;IAC7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|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AskarProfileWallet = exports.AskarWallet = void 0;
|
|
18
|
+
var AskarWallet_1 = require("./AskarWallet");
|
|
19
|
+
Object.defineProperty(exports, "AskarWallet", { enumerable: true, get: function () { return AskarWallet_1.AskarWallet; } });
|
|
20
|
+
var AskarProfileWallet_1 = require("./AskarProfileWallet");
|
|
21
|
+
Object.defineProperty(exports, "AskarProfileWallet", { enumerable: true, get: function () { return AskarProfileWallet_1.AskarProfileWallet; } });
|
|
22
|
+
__exportStar(require("./AskarWalletStorageConfig"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA0C"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@credo-ts/askar",
|
|
3
|
+
"main": "build/index",
|
|
4
|
+
"types": "build/index",
|
|
5
|
+
"version": "0.4.1-alpha.157+b83c5173",
|
|
6
|
+
"files": [
|
|
7
|
+
"build"
|
|
8
|
+
],
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/openwallet-foundation/credo-ts/tree/main/packages/askar",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/openwallet-foundation/credo-ts",
|
|
17
|
+
"directory": "packages/askar"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "yarn run clean && yarn run compile",
|
|
21
|
+
"clean": "rimraf ./build",
|
|
22
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
23
|
+
"prepublishOnly": "yarn run build",
|
|
24
|
+
"test": "jest"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@credo-ts/core": "0.4.1-alpha.157+b83c5173",
|
|
28
|
+
"bn.js": "^5.2.1",
|
|
29
|
+
"class-transformer": "0.5.1",
|
|
30
|
+
"class-validator": "0.14.1",
|
|
31
|
+
"rxjs": "^7.8.0",
|
|
32
|
+
"tsyringe": "^4.8.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@hyperledger/aries-askar-nodejs": "^0.2.0",
|
|
36
|
+
"@hyperledger/aries-askar-shared": "^0.2.0",
|
|
37
|
+
"@types/bn.js": "^5.1.0",
|
|
38
|
+
"@types/ref-array-di": "^1.2.6",
|
|
39
|
+
"@types/ref-struct-di": "^1.1.10",
|
|
40
|
+
"reflect-metadata": "^0.1.13",
|
|
41
|
+
"rimraf": "^4.4.0",
|
|
42
|
+
"typescript": "~4.9.5"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@hyperledger/aries-askar-shared": "^0.2.0"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "b83c5173070594448d92f801331b3a31c7ac8049"
|
|
48
|
+
}
|