@credo-ts/askar 0.6.1-pr-2091-20241119140918 → 0.6.1
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/build/AskarApi.d.mts +68 -0
- package/build/AskarApi.d.mts.map +1 -0
- package/build/AskarApi.mjs +94 -0
- package/build/AskarApi.mjs.map +1 -0
- package/build/AskarApiOptions.d.mts +29 -0
- package/build/AskarApiOptions.d.mts.map +1 -0
- package/build/AskarModule.d.mts +18 -0
- package/build/AskarModule.d.mts.map +1 -0
- package/build/AskarModule.mjs +61 -0
- package/build/AskarModule.mjs.map +1 -0
- package/build/AskarModuleConfig.d.mts +125 -0
- package/build/AskarModuleConfig.d.mts.map +1 -0
- package/build/AskarModuleConfig.mjs +41 -0
- package/build/AskarModuleConfig.mjs.map +1 -0
- package/build/AskarStorageConfig.d.mts +32 -0
- package/build/AskarStorageConfig.d.mts.map +1 -0
- package/build/AskarStorageConfig.mjs +11 -0
- package/build/AskarStorageConfig.mjs.map +1 -0
- package/build/AskarStoreManager.d.mts +109 -0
- package/build/AskarStoreManager.d.mts.map +1 -0
- package/build/AskarStoreManager.mjs +386 -0
- package/build/AskarStoreManager.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/error/AskarError.d.mts +1 -0
- package/build/error/AskarError.mjs +12 -0
- package/build/error/AskarError.mjs.map +1 -0
- package/build/error/AskarStoreDuplicateError.d.mts +13 -0
- package/build/error/AskarStoreDuplicateError.d.mts.map +1 -0
- package/build/error/AskarStoreDuplicateError.mjs +12 -0
- package/build/error/AskarStoreDuplicateError.mjs.map +1 -0
- package/build/error/AskarStoreError.d.mts +13 -0
- package/build/error/AskarStoreError.d.mts.map +1 -0
- package/build/error/AskarStoreError.mjs +12 -0
- package/build/error/AskarStoreError.mjs.map +1 -0
- package/build/error/AskarStoreExportPathExistsError.d.mts +13 -0
- package/build/error/AskarStoreExportPathExistsError.d.mts.map +1 -0
- package/build/error/AskarStoreExportPathExistsError.mjs +12 -0
- package/build/error/AskarStoreExportPathExistsError.mjs.map +1 -0
- package/build/error/AskarStoreExportUnsupportedError.d.mts +13 -0
- package/build/error/AskarStoreExportUnsupportedError.d.mts.map +1 -0
- package/build/error/AskarStoreExportUnsupportedError.mjs +12 -0
- package/build/error/AskarStoreExportUnsupportedError.mjs.map +1 -0
- package/build/error/AskarStoreImportPathExistsError.d.mts +13 -0
- package/build/error/AskarStoreImportPathExistsError.d.mts.map +1 -0
- package/build/error/AskarStoreImportPathExistsError.mjs +12 -0
- package/build/error/AskarStoreImportPathExistsError.mjs.map +1 -0
- package/build/error/AskarStoreInvalidKeyError.d.mts +13 -0
- package/build/error/AskarStoreInvalidKeyError.d.mts.map +1 -0
- package/build/error/AskarStoreInvalidKeyError.mjs +12 -0
- package/build/error/AskarStoreInvalidKeyError.mjs.map +1 -0
- package/build/error/AskarStoreNotFoundError.d.mts +13 -0
- package/build/error/AskarStoreNotFoundError.d.mts.map +1 -0
- package/build/error/AskarStoreNotFoundError.mjs +12 -0
- package/build/error/AskarStoreNotFoundError.mjs.map +1 -0
- package/build/error/index.d.mts +8 -0
- package/build/error/index.mjs +8 -0
- package/build/index.d.mts +19 -0
- package/build/index.mjs +19 -0
- package/build/kms/AskarKeyManagementService.d.mts +30 -0
- package/build/kms/AskarKeyManagementService.d.mts.map +1 -0
- package/build/kms/AskarKeyManagementService.mjs +415 -0
- package/build/kms/AskarKeyManagementService.mjs.map +1 -0
- package/build/kms/crypto/decrypt.mjs +21 -0
- package/build/kms/crypto/decrypt.mjs.map +1 -0
- package/build/kms/crypto/deriveKey.mjs +87 -0
- package/build/kms/crypto/deriveKey.mjs.map +1 -0
- package/build/kms/crypto/encrypt.mjs +24 -0
- package/build/kms/crypto/encrypt.mjs.map +1 -0
- package/build/kms/crypto/randomBytes.mjs +19 -0
- package/build/kms/crypto/randomBytes.mjs.map +1 -0
- package/build/storage/AskarStorageService.d.mts +34 -0
- package/build/storage/AskarStorageService.d.mts.map +1 -0
- package/build/storage/AskarStorageService.mjs +169 -0
- package/build/storage/AskarStorageService.mjs.map +1 -0
- package/build/storage/index.d.mts +1 -0
- package/build/storage/index.mjs +1 -0
- package/build/storage/utils.d.mts +8 -0
- package/build/storage/utils.d.mts.map +1 -0
- package/build/storage/utils.mjs +58 -0
- package/build/storage/utils.mjs.map +1 -0
- package/build/tenants.mjs +42 -0
- package/build/tenants.mjs.map +1 -0
- package/build/utils/askarError.d.mts +1 -0
- package/build/utils/askarError.mjs +21 -0
- package/build/utils/askarError.mjs.map +1 -0
- package/build/utils/askarKeyTypes.d.mts +2 -0
- package/build/utils/askarKeyTypes.mjs +25 -0
- package/build/utils/askarKeyTypes.mjs.map +1 -0
- package/build/utils/askarStoreConfig.d.mts +2 -0
- package/build/utils/askarStoreConfig.mjs +47 -0
- package/build/utils/askarStoreConfig.mjs.map +1 -0
- package/build/utils/index.d.mts +4 -0
- package/build/utils/index.mjs +4 -0
- package/build/utils/transformPrivateKey.d.mts +73 -0
- package/build/utils/transformPrivateKey.d.mts.map +1 -0
- package/build/utils/transformPrivateKey.mjs +73 -0
- package/build/utils/transformPrivateKey.mjs.map +1 -0
- package/package.json +21 -29
- package/build/AskarModule.d.ts +0 -9
- package/build/AskarModule.js +0 -58
- package/build/AskarModule.js.map +0 -1
- package/build/AskarModuleConfig.d.ts +0 -68
- package/build/AskarModuleConfig.js +0 -33
- package/build/AskarModuleConfig.js.map +0 -1
- package/build/index.d.ts +0 -4
- package/build/index.js +0 -16
- package/build/index.js.map +0 -1
- package/build/secureEnvironment/index.d.ts +0 -1
- package/build/secureEnvironment/index.js +0 -18
- package/build/secureEnvironment/index.js.map +0 -1
- package/build/secureEnvironment/secureEnvironment.d.ts +0 -5
- package/build/secureEnvironment/secureEnvironment.js +0 -7
- package/build/secureEnvironment/secureEnvironment.js.map +0 -1
- package/build/secureEnvironment/secureEnvironment.native.d.ts +0 -1
- package/build/secureEnvironment/secureEnvironment.native.js +0 -14
- package/build/secureEnvironment/secureEnvironment.native.js.map +0 -1
- package/build/storage/AskarStorageService.d.ts +0 -17
- package/build/storage/AskarStorageService.js +0 -141
- package/build/storage/AskarStorageService.js.map +0 -1
- package/build/storage/index.d.ts +0 -1
- package/build/storage/index.js +0 -18
- package/build/storage/index.js.map +0 -1
- package/build/storage/utils.d.ts +0 -15
- package/build/storage/utils.js +0 -109
- package/build/storage/utils.js.map +0 -1
- package/build/utils/askarError.d.ts +0 -14
- package/build/utils/askarError.js +0 -20
- package/build/utils/askarError.js.map +0 -1
- package/build/utils/askarKeyBackend.d.ts +0 -3
- package/build/utils/askarKeyBackend.js +0 -15
- package/build/utils/askarKeyBackend.js.map +0 -1
- package/build/utils/askarKeyTypes.d.ts +0 -8
- package/build/utils/askarKeyTypes.js +0 -46
- package/build/utils/askarKeyTypes.js.map +0 -1
- package/build/utils/askarWalletConfig.d.ts +0 -14
- package/build/utils/askarWalletConfig.js +0 -75
- package/build/utils/askarWalletConfig.js.map +0 -1
- package/build/utils/assertAskarWallet.d.ts +0 -3
- package/build/utils/assertAskarWallet.js +0 -14
- package/build/utils/assertAskarWallet.js.map +0 -1
- package/build/utils/index.d.ts +0 -3
- package/build/utils/index.js +0 -20
- package/build/utils/index.js.map +0 -1
- package/build/wallet/AskarBaseWallet.d.ts +0 -112
- package/build/wallet/AskarBaseWallet.js +0 -540
- package/build/wallet/AskarBaseWallet.js.map +0 -1
- package/build/wallet/AskarProfileWallet.d.ts +0 -24
- package/build/wallet/AskarProfileWallet.js +0 -150
- package/build/wallet/AskarProfileWallet.js.map +0 -1
- package/build/wallet/AskarWallet.d.ts +0 -58
- package/build/wallet/AskarWallet.js +0 -342
- package/build/wallet/AskarWallet.js.map +0 -1
- package/build/wallet/AskarWalletStorageConfig.d.ts +0 -31
- package/build/wallet/AskarWalletStorageConfig.js +0 -11
- package/build/wallet/AskarWalletStorageConfig.js.map +0 -1
- package/build/wallet/JweEnvelope.d.ts +0 -32
- package/build/wallet/JweEnvelope.js +0 -55
- package/build/wallet/JweEnvelope.js.map +0 -1
- package/build/wallet/didcommV1.d.ts +0 -8
- package/build/wallet/didcommV1.js +0 -155
- package/build/wallet/didcommV1.js.map +0 -1
- package/build/wallet/index.d.ts +0 -3
- package/build/wallet/index.js +0 -23
- package/build/wallet/index.js.map +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertAskarWallet = assertAskarWallet;
|
|
4
|
-
const core_1 = require("@credo-ts/core");
|
|
5
|
-
const wallet_1 = require("../wallet");
|
|
6
|
-
function assertAskarWallet(wallet) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
if (!(wallet instanceof wallet_1.AskarProfileWallet) && !(wallet instanceof wallet_1.AskarWallet)) {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const walletClassName = (_b = (_a = wallet.constructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'unknown';
|
|
11
|
-
throw new core_1.CredoError(`Expected wallet to be instance of AskarProfileWallet or AskarWallet, found ${walletClassName}`);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=assertAskarWallet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertAskarWallet.js","sourceRoot":"","sources":["../../src/utils/assertAskarWallet.ts"],"names":[],"mappings":";;AAMA,8CAQC;AAZD,yCAA2C;AAE3C,sCAA2D;AAE3D,SAAgB,iBAAiB,CAAC,MAAc;;IAC9C,IAAI,CAAC,CAAC,MAAM,YAAY,2BAAkB,CAAC,IAAI,CAAC,CAAC,MAAM,YAAY,oBAAW,CAAC,EAAE,CAAC;QAChF,8DAA8D;QAC9D,MAAM,eAAe,GAAG,MAAA,MAAC,MAAc,CAAC,WAAW,0CAAE,IAAI,mCAAI,SAAS,CAAA;QACtE,MAAM,IAAI,iBAAU,CAClB,8EAA8E,eAAe,EAAE,CAChG,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/build/utils/index.d.ts
DELETED
package/build/utils/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
__exportStar(require("./askarError"), exports);
|
|
18
|
-
__exportStar(require("./askarKeyTypes"), exports);
|
|
19
|
-
__exportStar(require("./askarWalletConfig"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/build/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,kDAA+B;AAC/B,sDAAmC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import type { EncryptedMessage, WalletConfig, WalletCreateKeyOptions, WalletSignOptions, UnpackedMessageContext, WalletVerifyOptions, Wallet, WalletConfigRekey, WalletExportImportConfig, Logger, SigningProviderRegistry, WalletDirectEncryptCompactJwtEcdhEsOptions } from '@credo-ts/core';
|
|
2
|
-
import type { Session } from '@hyperledger/aries-askar-shared';
|
|
3
|
-
import { Buffer, Key, KeyType } from '@credo-ts/core';
|
|
4
|
-
import { Store } from '@hyperledger/aries-askar-shared';
|
|
5
|
-
export declare abstract class AskarBaseWallet implements Wallet {
|
|
6
|
-
protected logger: Logger;
|
|
7
|
-
protected signingKeyProviderRegistry: SigningProviderRegistry;
|
|
8
|
-
constructor(logger: Logger, signingKeyProviderRegistry: SigningProviderRegistry);
|
|
9
|
-
/**
|
|
10
|
-
* Abstract methods that need to be implemented by subclasses
|
|
11
|
-
*/
|
|
12
|
-
abstract isInitialized: boolean;
|
|
13
|
-
abstract isProvisioned: boolean;
|
|
14
|
-
abstract create(walletConfig: WalletConfig): Promise<void>;
|
|
15
|
-
abstract createAndOpen(walletConfig: WalletConfig): Promise<void>;
|
|
16
|
-
abstract open(walletConfig: WalletConfig): Promise<void>;
|
|
17
|
-
abstract rotateKey(walletConfig: WalletConfigRekey): Promise<void>;
|
|
18
|
-
abstract close(): Promise<void>;
|
|
19
|
-
abstract delete(): Promise<void>;
|
|
20
|
-
abstract export(exportConfig: WalletExportImportConfig): Promise<void>;
|
|
21
|
-
abstract import(walletConfig: WalletConfig, importConfig: WalletExportImportConfig): Promise<void>;
|
|
22
|
-
abstract dispose(): void | Promise<void>;
|
|
23
|
-
abstract profile: string;
|
|
24
|
-
protected abstract store: Store;
|
|
25
|
-
/**
|
|
26
|
-
* Run callback with the session provided, the session will
|
|
27
|
-
* be closed once the callback resolves or rejects if it is not closed yet.
|
|
28
|
-
*
|
|
29
|
-
* TODO: update to new `using` syntax so we don't have to use a callback
|
|
30
|
-
*/
|
|
31
|
-
withSession<Return>(callback: (session: Session) => Return): Promise<Awaited<Return>>;
|
|
32
|
-
/**
|
|
33
|
-
* Run callback with a transaction. If the callback resolves the transaction
|
|
34
|
-
* will be committed if the transaction is not closed yet. If the callback rejects
|
|
35
|
-
* the transaction will be rolled back if the transaction is not closed yet.
|
|
36
|
-
*
|
|
37
|
-
* TODO: update to new `using` syntax so we don't have to use a callback
|
|
38
|
-
*/
|
|
39
|
-
withTransaction<Return>(callback: (transaction: Session) => Return): Promise<Awaited<Return>>;
|
|
40
|
-
get supportedKeyTypes(): KeyType[];
|
|
41
|
-
/**
|
|
42
|
-
* Create a key with an optional seed and keyType.
|
|
43
|
-
* The keypair is also automatically stored in the wallet afterwards
|
|
44
|
-
*/
|
|
45
|
-
createKey({ seed, privateKey, keyType, keyId, keyBackend, }: WalletCreateKeyOptions): Promise<Key>;
|
|
46
|
-
/**
|
|
47
|
-
* sign a Buffer with an instance of a Key class
|
|
48
|
-
*
|
|
49
|
-
* @param data Buffer The data that needs to be signed
|
|
50
|
-
* @param key Key The key that is used to sign the data
|
|
51
|
-
*
|
|
52
|
-
* @returns A signature for the data
|
|
53
|
-
*/
|
|
54
|
-
sign({ data, key }: WalletSignOptions): Promise<Buffer>;
|
|
55
|
-
/**
|
|
56
|
-
* Verify the signature with the data and the used key
|
|
57
|
-
*
|
|
58
|
-
* @param data Buffer The data that has to be confirmed to be signed
|
|
59
|
-
* @param key Key The key that was used in the signing process
|
|
60
|
-
* @param signature Buffer The signature that was created by the signing process
|
|
61
|
-
*
|
|
62
|
-
* @returns A boolean whether the signature was created with the supplied data and key
|
|
63
|
-
*
|
|
64
|
-
* @throws {WalletError} When it could not do the verification
|
|
65
|
-
* @throws {WalletError} When an unsupported keytype is used
|
|
66
|
-
*/
|
|
67
|
-
verify({ data, key, signature }: WalletVerifyOptions): Promise<boolean>;
|
|
68
|
-
/**
|
|
69
|
-
* Pack a message using DIDComm V1 algorithm
|
|
70
|
-
*
|
|
71
|
-
* @param payload message to send
|
|
72
|
-
* @param recipientKeys array containing recipient keys in base58
|
|
73
|
-
* @param senderVerkey sender key in base58
|
|
74
|
-
* @returns JWE Envelope to send
|
|
75
|
-
*/
|
|
76
|
-
pack(payload: Record<string, unknown>, recipientKeys: string[], senderVerkey?: string): Promise<EncryptedMessage>;
|
|
77
|
-
/**
|
|
78
|
-
* Unpacks a JWE Envelope coded using DIDComm V1 algorithm
|
|
79
|
-
*
|
|
80
|
-
* @param messagePackage JWE Envelope
|
|
81
|
-
* @returns UnpackedMessageContext with plain text message, sender key and recipient key
|
|
82
|
-
*/
|
|
83
|
-
unpack(messagePackage: EncryptedMessage): Promise<UnpackedMessageContext>;
|
|
84
|
-
/**
|
|
85
|
-
* Method that enables JWE encryption using ECDH-ES and AesA256Gcm and returns it as a compact JWE.
|
|
86
|
-
* This method is specifically added to support OpenID4VP response encryption using JARM and should later be
|
|
87
|
-
* refactored into a more generic method that supports encryption/decryption.
|
|
88
|
-
*
|
|
89
|
-
* @returns compact JWE
|
|
90
|
-
*/
|
|
91
|
-
directEncryptCompactJweEcdhEs({ recipientKey, encryptionAlgorithm, apu, apv, data, header, }: WalletDirectEncryptCompactJwtEcdhEsOptions): Promise<string>;
|
|
92
|
-
/**
|
|
93
|
-
* Method that enables JWE decryption using ECDH-ES and AesA256Gcm and returns it as plaintext buffer with the header.
|
|
94
|
-
* The apv and apu values are extracted from the heaader, and thus on a higher level it should be checked that these
|
|
95
|
-
* values are correct.
|
|
96
|
-
*/
|
|
97
|
-
directDecryptCompactJweEcdhEs({ compactJwe, recipientKey, }: {
|
|
98
|
-
compactJwe: string;
|
|
99
|
-
recipientKey: Key;
|
|
100
|
-
}): Promise<{
|
|
101
|
-
data: Buffer;
|
|
102
|
-
header: Record<string, unknown>;
|
|
103
|
-
}>;
|
|
104
|
-
generateNonce(): Promise<string>;
|
|
105
|
-
getRandomValues(length: number): Uint8Array;
|
|
106
|
-
generateWalletKey(): Promise<string>;
|
|
107
|
-
private retrieveKeyPair;
|
|
108
|
-
private getSecureEnvironmentKey;
|
|
109
|
-
private deleteKeyPair;
|
|
110
|
-
private storeKeyPair;
|
|
111
|
-
private storeSecureEnvironmentKeyById;
|
|
112
|
-
}
|