@credo-ts/didcomm 0.6.0-pr-2195-20250322195244 → 0.6.0-pr-2324-20250625125220
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/DidCommModule.js +0 -1
- package/build/DidCommModule.js.map +1 -1
- package/build/DidCommModuleConfig.d.ts +8 -0
- package/build/DidCommModuleConfig.js +9 -0
- package/build/DidCommModuleConfig.js.map +1 -1
- package/build/EnvelopeService.d.ts +13 -8
- package/build/EnvelopeService.js +281 -21
- package/build/EnvelopeService.js.map +1 -1
- package/build/MessageSender.d.ts +4 -6
- package/build/MessageSender.js +60 -70
- package/build/MessageSender.js.map +1 -1
- package/build/decorators/service/ServiceDecorator.js +4 -4
- package/build/decorators/service/ServiceDecorator.js.map +1 -1
- package/build/decorators/signature/SignatureDecoratorUtils.d.ts +5 -4
- package/build/decorators/signature/SignatureDecoratorUtils.js +22 -12
- package/build/decorators/signature/SignatureDecoratorUtils.js.map +1 -1
- package/build/getOutboundMessageContext.js +30 -5
- package/build/getOutboundMessageContext.js.map +1 -1
- package/build/models/InboundMessageContext.d.ts +5 -5
- package/build/models/OutboundMessageContext.d.ts +2 -2
- package/build/models/Routing.d.ts +3 -3
- package/build/modules/connections/ConnectionsApi.js +6 -5
- package/build/modules/connections/ConnectionsApi.js.map +1 -1
- package/build/modules/connections/DidExchangeProtocol.d.ts +3 -1
- package/build/modules/connections/DidExchangeProtocol.js +95 -57
- package/build/modules/connections/DidExchangeProtocol.js.map +1 -1
- package/build/modules/connections/handlers/ConnectionRequestHandler.js +7 -0
- package/build/modules/connections/handlers/ConnectionRequestHandler.js.map +1 -1
- package/build/modules/connections/handlers/ConnectionResponseHandler.js +4 -0
- package/build/modules/connections/handlers/ConnectionResponseHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeCompleteHandler.js +0 -4
- package/build/modules/connections/handlers/DidExchangeCompleteHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeRequestHandler.js +3 -0
- package/build/modules/connections/handlers/DidExchangeRequestHandler.js.map +1 -1
- package/build/modules/connections/handlers/DidExchangeResponseHandler.js +3 -3
- package/build/modules/connections/handlers/DidExchangeResponseHandler.js.map +1 -1
- package/build/modules/connections/messages/ConnectionInvitationMessage.d.ts +2 -1
- package/build/modules/connections/messages/ConnectionInvitationMessage.js.map +1 -1
- package/build/modules/connections/models/did/DidDoc.js +2 -2
- package/build/modules/connections/models/did/DidDoc.js.map +1 -1
- package/build/modules/connections/repository/ConnectionRecord.d.ts +2 -0
- package/build/modules/connections/repository/ConnectionRecord.js +2 -0
- package/build/modules/connections/repository/ConnectionRecord.js.map +1 -1
- package/build/modules/connections/repository/ConnectionRepository.d.ts +1 -1
- package/build/modules/connections/repository/ConnectionRepository.js +2 -0
- package/build/modules/connections/repository/ConnectionRepository.js.map +1 -1
- package/build/modules/connections/services/ConnectionService.d.ts +4 -4
- package/build/modules/connections/services/ConnectionService.js +92 -41
- package/build/modules/connections/services/ConnectionService.js.map +1 -1
- package/build/modules/connections/services/DidRotateService.js +9 -10
- package/build/modules/connections/services/DidRotateService.js.map +1 -1
- package/build/modules/connections/services/helpers.d.ts +20 -6
- package/build/modules/connections/services/helpers.js +46 -29
- package/build/modules/connections/services/helpers.js.map +1 -1
- package/build/modules/credentials/models/RevocationNotification.js +14 -0
- package/build/modules/credentials/models/RevocationNotification.js.map +1 -1
- package/build/modules/credentials/protocol/index.js +17 -7
- package/build/modules/credentials/protocol/index.js.map +1 -1
- package/build/modules/credentials/repository/CredentialExchangeRecord.d.ts +1 -1
- package/build/modules/credentials/repository/CredentialExchangeRecord.js +5 -0
- package/build/modules/credentials/repository/CredentialExchangeRecord.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupApi.js +7 -2
- package/build/modules/message-pickup/MessagePickupApi.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupApiOptions.d.ts +1 -1
- package/build/modules/message-pickup/MessagePickupModule.d.ts +1 -0
- package/build/modules/message-pickup/MessagePickupModule.js +6 -11
- package/build/modules/message-pickup/MessagePickupModule.js.map +1 -1
- package/build/modules/message-pickup/MessagePickupModuleConfig.d.ts +0 -8
- package/build/modules/message-pickup/MessagePickupModuleConfig.js +0 -4
- package/build/modules/message-pickup/MessagePickupModuleConfig.js.map +1 -1
- package/build/modules/message-pickup/index.d.ts +0 -1
- package/build/modules/message-pickup/index.js +0 -1
- package/build/modules/message-pickup/index.js.map +1 -1
- package/build/modules/message-pickup/protocol/MessagePickupProtocolOptions.d.ts +1 -1
- package/build/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.js +6 -5
- package/build/modules/message-pickup/protocol/v1/V1MessagePickupProtocol.js.map +1 -1
- package/build/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.js +22 -13
- package/build/modules/message-pickup/protocol/v2/V2MessagePickupProtocol.js.map +1 -1
- package/build/modules/oob/OutOfBandApi.js +21 -8
- package/build/modules/oob/OutOfBandApi.js.map +1 -1
- package/build/modules/oob/OutOfBandService.d.ts +9 -5
- package/build/modules/oob/OutOfBandService.js +7 -2
- package/build/modules/oob/OutOfBandService.js.map +1 -1
- package/build/modules/oob/converters.js +2 -4
- package/build/modules/oob/converters.js.map +1 -1
- package/build/modules/oob/domain/OutOfBandDidCommService.js +14 -2
- package/build/modules/oob/domain/OutOfBandDidCommService.js.map +1 -1
- package/build/modules/oob/helpers.js +6 -6
- package/build/modules/oob/helpers.js.map +1 -1
- package/build/modules/oob/messages/OutOfBandInvitation.js.map +1 -1
- package/build/modules/oob/repository/OutOfBandRecord.d.ts +34 -0
- package/build/modules/oob/repository/OutOfBandRecord.js +1 -0
- package/build/modules/oob/repository/OutOfBandRecord.js.map +1 -1
- package/build/modules/oob/repository/outOfBandRecordMetadataTypes.d.ts +4 -0
- package/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js +7 -4
- package/build/modules/proofs/formats/dif-presentation-exchange/DifPresentationExchangeProofFormatService.js.map +1 -1
- package/build/modules/proofs/formats/index.js +17 -7
- package/build/modules/proofs/formats/index.js.map +1 -1
- package/build/modules/proofs/protocol/index.js +17 -7
- package/build/modules/proofs/protocol/index.js.map +1 -1
- package/build/modules/routing/MediationRecipientApi.d.ts +0 -2
- package/build/modules/routing/MediationRecipientApi.js +1 -46
- package/build/modules/routing/MediationRecipientApi.js.map +1 -1
- package/build/modules/routing/MediationRecipientModule.d.ts +3 -0
- package/build/modules/routing/MediationRecipientModule.js +60 -0
- package/build/modules/routing/MediationRecipientModule.js.map +1 -1
- package/build/modules/routing/MediatorModule.d.ts +1 -0
- package/build/modules/routing/MediatorModule.js +5 -0
- package/build/modules/routing/MediatorModule.js.map +1 -1
- package/build/modules/routing/MediatorModuleConfig.d.ts +2 -2
- package/build/modules/routing/MessageForwardingStrategy.js +2 -2
- package/build/modules/routing/MessageForwardingStrategy.js.map +1 -1
- package/build/modules/routing/repository/MediationRecord.d.ts +8 -0
- package/build/modules/routing/repository/MediationRecord.js +2 -0
- package/build/modules/routing/repository/MediationRecord.js.map +1 -1
- package/build/modules/routing/repository/MediatorRoutingRecord.d.ts +23 -5
- package/build/modules/routing/repository/MediatorRoutingRecord.js +33 -1
- package/build/modules/routing/repository/MediatorRoutingRecord.js.map +1 -1
- package/build/modules/routing/services/MediationRecipientService.d.ts +3 -3
- package/build/modules/routing/services/MediationRecipientService.js +15 -12
- package/build/modules/routing/services/MediationRecipientService.js.map +1 -1
- package/build/modules/routing/services/MediatorService.js +17 -9
- package/build/modules/routing/services/MediatorService.js.map +1 -1
- package/build/modules/routing/services/RoutingService.d.ts +3 -3
- package/build/modules/routing/services/RoutingService.js +4 -3
- package/build/modules/routing/services/RoutingService.js.map +1 -1
- package/build/modules/routing/services/helpers.d.ts +1 -1
- package/build/modules/routing/services/helpers.js +3 -4
- package/build/modules/routing/services/helpers.js.map +1 -1
- package/build/services/DidCommDocumentService.d.ts +8 -3
- package/build/services/DidCommDocumentService.js +46 -15
- package/build/services/DidCommDocumentService.js.map +1 -1
- package/build/transport/HttpOutboundTransport.js +2 -4
- package/build/transport/HttpOutboundTransport.js.map +1 -1
- package/build/transport/index.d.ts +1 -0
- package/build/transport/index.js +1 -0
- package/build/transport/index.js.map +1 -1
- package/build/transport/queue/InMemoryQueueTransportRepository.d.ts +12 -0
- package/build/{modules/message-pickup/storage/InMemoryMessagePickupRepository.js → transport/queue/InMemoryQueueTransportRepository.js} +15 -19
- package/build/transport/queue/InMemoryQueueTransportRepository.js.map +1 -0
- package/build/transport/queue/QueueTransportRepository.d.ts +9 -0
- package/build/{modules/message-pickup/storage/MessagePickupRepository.js → transport/queue/QueueTransportRepository.js} +1 -1
- package/build/transport/queue/QueueTransportRepository.js.map +1 -0
- package/build/{modules/message-pickup/storage/MessagePickupRepositoryOptions.d.ts → transport/queue/QueueTransportRepositoryOptions.d.ts} +2 -1
- package/build/{modules/message-pickup/storage/MessagePickupRepositoryOptions.js → transport/queue/QueueTransportRepositoryOptions.js} +1 -1
- package/build/transport/queue/QueueTransportRepositoryOptions.js.map +1 -0
- package/build/{modules/message-pickup/storage → transport/queue}/QueuedMessage.d.ts +2 -2
- package/build/transport/queue/QueuedMessage.js.map +1 -0
- package/build/transport/queue/index.d.ts +4 -0
- package/build/{modules/message-pickup/storage → transport/queue}/index.js +3 -3
- package/build/transport/queue/index.js.map +1 -0
- package/build/updates/0.1-0.2/connection.js +3 -3
- package/build/updates/0.1-0.2/connection.js.map +1 -1
- package/build/util/modules.d.ts +1 -1
- package/build/util/modules.js +3 -1
- package/build/util/modules.js.map +1 -1
- package/build/util/parseInvitation.js +0 -2
- package/build/util/parseInvitation.js.map +1 -1
- package/package.json +7 -7
- package/build/modules/message-pickup/storage/InMemoryMessagePickupRepository.d.ts +0 -13
- package/build/modules/message-pickup/storage/InMemoryMessagePickupRepository.js.map +0 -1
- package/build/modules/message-pickup/storage/MessagePickupRepository.d.ts +0 -8
- package/build/modules/message-pickup/storage/MessagePickupRepository.js.map +0 -1
- package/build/modules/message-pickup/storage/MessagePickupRepositoryOptions.js.map +0 -1
- package/build/modules/message-pickup/storage/QueuedMessage.js.map +0 -1
- package/build/modules/message-pickup/storage/index.d.ts +0 -4
- package/build/modules/message-pickup/storage/index.js.map +0 -1
- package/build/util/matchingEd25519Key.d.ts +0 -9
- package/build/util/matchingEd25519Key.js +0 -30
- package/build/util/matchingEd25519Key.js.map +0 -1
- /package/build/{modules/message-pickup/storage → transport/queue}/QueuedMessage.js +0 -0
package/build/DidCommModule.js
CHANGED
|
@@ -85,7 +85,6 @@ class DidCommModule {
|
|
|
85
85
|
await transport.start(agentContext);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
// TODO: Shall shutdown and initialize be part of API (so Agent can be stopped/restarted without creating a new instance)?
|
|
89
88
|
async shutdown(agentContext) {
|
|
90
89
|
const messageReceiver = agentContext.dependencyManager.resolve(MessageReceiver_1.MessageReceiver);
|
|
91
90
|
const messageSender = agentContext.dependencyManager.resolve(MessageSender_1.MessageSender);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommModule.js","sourceRoot":"","sources":["../src/DidCommModule.ts"],"names":[],"mappings":";;;AAKA,yCAA+D;AAC/D,+BAA0C;AAE1C,6CAAyC;AACzC,+DAA2D;AAC3D,6CAAyC;AACzC,uDAAmD;AACnD,qCAA0C;AAC1C,uDAAmD;AACnD,qEAAiE;AACjE,uDAAmD;AACnD,mDAA+C;AAC/C,yDAAqD;AACrD,6CAAuD;AACvD,gDAAoD;AACpD,gDAAoD;AACpD,gDAAoD;AAEpD,MAAa,aAAa;IAIxB,YAAmB,MAAmC;QAFtC,QAAG,GAAG,uBAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"DidCommModule.js","sourceRoot":"","sources":["../src/DidCommModule.ts"],"names":[],"mappings":";;;AAKA,yCAA+D;AAC/D,+BAA0C;AAE1C,6CAAyC;AACzC,+DAA2D;AAC3D,6CAAyC;AACzC,uDAAmD;AACnD,qCAA0C;AAC1C,uDAAmD;AACnD,qEAAiE;AACjE,uDAA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D,MAAM,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QACrC,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,YAA0B;QAC9C,MAAM,eAAe,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,iCAAe,CAAC,CAAA;QAC/E,MAAM,aAAa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,6BAAa,CAAC,CAAA;QAE3E,kBAAkB;QAClB,MAAM,aAAa,GAAG,CAAC,GAAG,eAAe,CAAC,iBAAiB,EAAE,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAA;QACjG,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;QAC5E,MAAM,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACtC,CAAC;CAmBF;AAjGD,sCAiGC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { QueueTransportRepository } from './transport';
|
|
1
2
|
/**
|
|
2
3
|
* MediatorModuleConfigOptions defines the interface for the options of the MediatorModuleConfig class.
|
|
3
4
|
* This can contain optional parameters that have default values in the config class itself.
|
|
@@ -9,10 +10,12 @@ export interface DidCommModuleConfigOptions {
|
|
|
9
10
|
processDidCommMessagesConcurrently?: boolean;
|
|
10
11
|
didCommMimeType?: string;
|
|
11
12
|
useDidKeyInProtocols?: boolean;
|
|
13
|
+
queueTransportRepository?: QueueTransportRepository;
|
|
12
14
|
}
|
|
13
15
|
export declare class DidCommModuleConfig {
|
|
14
16
|
private options;
|
|
15
17
|
private _endpoints?;
|
|
18
|
+
private _queueTransportRepository;
|
|
16
19
|
constructor(options?: DidCommModuleConfigOptions);
|
|
17
20
|
get endpoints(): [string, ...string[]];
|
|
18
21
|
set endpoints(endpoints: string[]);
|
|
@@ -30,4 +33,9 @@ export declare class DidCommModuleConfig {
|
|
|
30
33
|
* in a given protocol (i.e. it does not support Aries RFC 0360).
|
|
31
34
|
*/
|
|
32
35
|
get useDidKeyInProtocols(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Allows to specify a custom queue transport queue. It defaults to an in-memory queue
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
get queueTransportRepository(): QueueTransportRepository;
|
|
33
41
|
}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DidCommModuleConfig = void 0;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
|
+
const transport_1 = require("./transport");
|
|
5
6
|
const types_1 = require("./types");
|
|
6
7
|
class DidCommModuleConfig {
|
|
7
8
|
constructor(options) {
|
|
8
9
|
this.options = options ?? {};
|
|
9
10
|
this._endpoints = options?.endpoints;
|
|
11
|
+
this._queueTransportRepository = options?.queueTransportRepository ?? new transport_1.InMemoryQueueTransportRepository();
|
|
10
12
|
}
|
|
11
13
|
get endpoints() {
|
|
12
14
|
// if endpoints is not set, return queue endpoint
|
|
@@ -43,6 +45,13 @@ class DidCommModuleConfig {
|
|
|
43
45
|
get useDidKeyInProtocols() {
|
|
44
46
|
return this.options.useDidKeyInProtocols ?? true;
|
|
45
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Allows to specify a custom queue transport queue. It defaults to an in-memory queue
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
get queueTransportRepository() {
|
|
53
|
+
return this._queueTransportRepository;
|
|
54
|
+
}
|
|
46
55
|
}
|
|
47
56
|
exports.DidCommModuleConfig = DidCommModuleConfig;
|
|
48
57
|
//# sourceMappingURL=DidCommModuleConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommModuleConfig.js","sourceRoot":"","sources":["../src/DidCommModuleConfig.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AACtD,mCAAyC;
|
|
1
|
+
{"version":3,"file":"DidCommModuleConfig.js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,yBAAyB,CAAA;IACvC,CAAC;CACF;AA7DD,kDA6DC"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AgentContext, Kms } from '@credo-ts/core';
|
|
2
2
|
import type { AgentMessage } from './AgentMessage';
|
|
3
3
|
import type { EncryptedMessage, PlaintextMessage } from './types';
|
|
4
|
-
import {
|
|
4
|
+
import { Logger } from '@credo-ts/core';
|
|
5
|
+
import { DidCommDocumentService } from './services/DidCommDocumentService';
|
|
5
6
|
export interface EnvelopeKeys {
|
|
6
|
-
recipientKeys:
|
|
7
|
-
routingKeys:
|
|
8
|
-
senderKey:
|
|
7
|
+
recipientKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[];
|
|
8
|
+
routingKeys: Kms.PublicJwk<Kms.Ed25519PublicJwk>[];
|
|
9
|
+
senderKey: Kms.PublicJwk<Kms.Ed25519PublicJwk> | null;
|
|
9
10
|
}
|
|
10
11
|
export declare class EnvelopeService {
|
|
11
12
|
private logger;
|
|
12
|
-
|
|
13
|
+
private didcommDocumentService;
|
|
14
|
+
constructor(logger: Logger, didcommDocumentService: DidCommDocumentService);
|
|
15
|
+
private encryptDidcommV1Message;
|
|
16
|
+
private decryptDidcommV1Message;
|
|
13
17
|
packMessage(agentContext: AgentContext, payload: AgentMessage, keys: EnvelopeKeys): Promise<EncryptedMessage>;
|
|
14
18
|
unpackMessage(agentContext: AgentContext, encryptedMessage: EncryptedMessage): Promise<DecryptedMessageContext>;
|
|
19
|
+
private extractOurRecipientKeyWithKeyId;
|
|
15
20
|
}
|
|
16
21
|
export interface DecryptedMessageContext {
|
|
17
22
|
plaintextMessage: PlaintextMessage;
|
|
18
|
-
senderKey?:
|
|
19
|
-
recipientKey
|
|
23
|
+
senderKey?: Kms.PublicJwk<Kms.Ed25519PublicJwk>;
|
|
24
|
+
recipientKey: Kms.PublicJwk<Kms.Ed25519PublicJwk>;
|
|
20
25
|
}
|
package/build/EnvelopeService.js
CHANGED
|
@@ -14,53 +14,313 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.EnvelopeService = void 0;
|
|
16
16
|
const core_1 = require("@credo-ts/core");
|
|
17
|
+
const core_2 = require("@credo-ts/core");
|
|
17
18
|
const DidCommModuleConfig_1 = require("./DidCommModuleConfig");
|
|
18
|
-
const
|
|
19
|
+
const helpers_1 = require("./modules/connections/services/helpers");
|
|
20
|
+
const OutOfBandRole_1 = require("./modules/oob/domain/OutOfBandRole");
|
|
21
|
+
const OutOfBandRepository_1 = require("./modules/oob/repository/OutOfBandRepository");
|
|
22
|
+
const outOfBandRecordMetadataTypes_1 = require("./modules/oob/repository/outOfBandRecordMetadataTypes");
|
|
23
|
+
const ForwardMessage_1 = require("./modules/routing/messages/ForwardMessage");
|
|
24
|
+
const MediatorRoutingRepository_1 = require("./modules/routing/repository/MediatorRoutingRepository");
|
|
25
|
+
const DidCommDocumentService_1 = require("./services/DidCommDocumentService");
|
|
19
26
|
let EnvelopeService = class EnvelopeService {
|
|
20
|
-
constructor(logger) {
|
|
27
|
+
constructor(logger, didcommDocumentService) {
|
|
21
28
|
this.logger = logger;
|
|
29
|
+
this.didcommDocumentService = didcommDocumentService;
|
|
30
|
+
}
|
|
31
|
+
async encryptDidcommV1Message(agentContext, message, recipientKeys, senderKey) {
|
|
32
|
+
const kms = agentContext.dependencyManager.resolve(core_1.Kms.KeyManagementApi);
|
|
33
|
+
// Generally we would never generate the content encryption key outside of the KMS
|
|
34
|
+
// However how DIDcommV1 is specified to calcualte the aad we need the encrypted content
|
|
35
|
+
// encryption key, and thus we can't use the normal combined key agrement + encryption flow
|
|
36
|
+
const contentEncryptionKey = kms.randomBytes({ length: 32 });
|
|
37
|
+
const recipients = [];
|
|
38
|
+
for (const recipientKey of recipientKeys) {
|
|
39
|
+
let encryptedSender = undefined;
|
|
40
|
+
if (senderKey) {
|
|
41
|
+
// Encrypt the sender
|
|
42
|
+
const { encrypted } = await kms.encrypt({
|
|
43
|
+
key: {
|
|
44
|
+
keyAgreement: {
|
|
45
|
+
algorithm: 'ECDH-HSALSA20',
|
|
46
|
+
// DIDComm v1 uses Ed25519 keys but encryption happens with X25519 keys
|
|
47
|
+
externalPublicJwk: recipientKey.convertTo(core_1.Kms.X25519PublicJwk).toJson(),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
encryption: {
|
|
51
|
+
algorithm: 'XSALSA20-POLY1305',
|
|
52
|
+
},
|
|
53
|
+
data: core_1.TypedArrayEncoder.fromString(core_1.TypedArrayEncoder.toBase58(senderKey.publicKey.publicKey)),
|
|
54
|
+
});
|
|
55
|
+
encryptedSender = core_1.TypedArrayEncoder.toBase64URL(encrypted);
|
|
56
|
+
}
|
|
57
|
+
// Encrypt the key
|
|
58
|
+
const { encrypted, iv } = await kms.encrypt({
|
|
59
|
+
key: {
|
|
60
|
+
keyAgreement: {
|
|
61
|
+
algorithm: 'ECDH-HSALSA20',
|
|
62
|
+
externalPublicJwk: recipientKey.convertTo(core_1.Kms.X25519PublicJwk).toJson(),
|
|
63
|
+
// Sender key only needed for Authcrypt
|
|
64
|
+
keyId: senderKey?.keyId,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
data: contentEncryptionKey,
|
|
68
|
+
encryption: {
|
|
69
|
+
algorithm: 'XSALSA20-POLY1305',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
recipients.push({
|
|
73
|
+
encrypted_key: core_1.TypedArrayEncoder.toBase64URL(encrypted),
|
|
74
|
+
header: {
|
|
75
|
+
kid: core_1.TypedArrayEncoder.toBase58(recipientKey.publicKey.publicKey),
|
|
76
|
+
iv: iv ? core_1.TypedArrayEncoder.toBase64URL(iv) : undefined,
|
|
77
|
+
sender: encryptedSender,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const protectedString = core_1.JsonEncoder.toBase64URL({
|
|
82
|
+
enc: 'xchacha20poly1305_ietf',
|
|
83
|
+
typ: 'JWM/1.0',
|
|
84
|
+
alg: senderKey ? 'Authcrypt' : 'Anoncrypt',
|
|
85
|
+
recipients,
|
|
86
|
+
});
|
|
87
|
+
// Perofrm the actual encryption
|
|
88
|
+
const { encrypted, iv, tag } = await kms.encrypt({
|
|
89
|
+
encryption: {
|
|
90
|
+
algorithm: 'C20P',
|
|
91
|
+
aad: core_1.TypedArrayEncoder.fromString(protectedString),
|
|
92
|
+
},
|
|
93
|
+
data: core_1.JsonEncoder.toBuffer(message),
|
|
94
|
+
key: {
|
|
95
|
+
privateJwk: {
|
|
96
|
+
kty: 'oct',
|
|
97
|
+
k: core_1.TypedArrayEncoder.toBase64URL(contentEncryptionKey),
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
if (!iv || !tag) {
|
|
102
|
+
throw new core_1.CredoError("Expected 'iv' and 'tag' to be defined");
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
ciphertext: core_1.TypedArrayEncoder.toBase64URL(encrypted),
|
|
106
|
+
iv: core_1.TypedArrayEncoder.toBase64URL(iv),
|
|
107
|
+
tag: core_1.TypedArrayEncoder.toBase64URL(tag),
|
|
108
|
+
protected: protectedString,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async decryptDidcommV1Message(agentContext, encryptedMessage) {
|
|
112
|
+
const kms = agentContext.dependencyManager.resolve(core_1.Kms.KeyManagementApi);
|
|
113
|
+
const protectedJson = core_1.JsonEncoder.fromBase64(encryptedMessage.protected);
|
|
114
|
+
const alg = protectedJson.alg;
|
|
115
|
+
if (alg !== 'Anoncrypt' && alg !== 'Authcrypt') {
|
|
116
|
+
throw new core_1.CredoError(`Unsupported pack algorithm: ${alg}`);
|
|
117
|
+
}
|
|
118
|
+
if (protectedJson.enc !== 'xchacha20poly1305_ietf') {
|
|
119
|
+
throw new core_1.CredoError(`Unsupported enc algorithm: ${protectedJson.enc}`);
|
|
120
|
+
}
|
|
121
|
+
let recipientKey = null;
|
|
122
|
+
let recipient = null;
|
|
123
|
+
for (const _recipient of protectedJson.recipients) {
|
|
124
|
+
recipientKey = await this.extractOurRecipientKeyWithKeyId(agentContext, _recipient);
|
|
125
|
+
if (recipientKey) {
|
|
126
|
+
recipient = _recipient;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (!recipientKey || !recipient) {
|
|
130
|
+
throw new core_1.CredoError('No corresponding recipient key found');
|
|
131
|
+
}
|
|
132
|
+
if (alg === 'Authcrypt' && (!recipient.header.sender || !recipient.header.iv)) {
|
|
133
|
+
throw new core_1.CredoError('Sender and iv header values are required for Authcrypt');
|
|
134
|
+
}
|
|
135
|
+
let senderPublicJwk = undefined;
|
|
136
|
+
if (recipient.header.sender) {
|
|
137
|
+
const { data } = await kms.decrypt({
|
|
138
|
+
key: {
|
|
139
|
+
keyAgreement: {
|
|
140
|
+
algorithm: 'ECDH-HSALSA20',
|
|
141
|
+
keyId: recipientKey.keyId,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
decryption: {
|
|
145
|
+
algorithm: 'XSALSA20-POLY1305',
|
|
146
|
+
},
|
|
147
|
+
encrypted: core_1.TypedArrayEncoder.fromBase64(recipient.header.sender),
|
|
148
|
+
});
|
|
149
|
+
senderPublicJwk = core_1.Kms.PublicJwk.fromPublicKey({
|
|
150
|
+
crv: 'Ed25519',
|
|
151
|
+
kty: 'OKP',
|
|
152
|
+
publicKey: core_1.TypedArrayEncoder.fromBase58(core_1.TypedArrayEncoder.toUtf8String(data)),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// Perofrm the actual decryption
|
|
156
|
+
const { data: contentEncryptionKey } = await kms.decrypt({
|
|
157
|
+
decryption: {
|
|
158
|
+
algorithm: 'XSALSA20-POLY1305',
|
|
159
|
+
iv: recipient.header.iv ? core_1.TypedArrayEncoder.fromBase64(recipient.header.iv) : undefined,
|
|
160
|
+
},
|
|
161
|
+
encrypted: core_1.TypedArrayEncoder.fromBase64(recipient.encrypted_key),
|
|
162
|
+
key: {
|
|
163
|
+
keyAgreement: {
|
|
164
|
+
algorithm: 'ECDH-HSALSA20',
|
|
165
|
+
keyId: recipientKey.keyId,
|
|
166
|
+
// Optionally we have a sender
|
|
167
|
+
externalPublicJwk: senderPublicJwk?.convertTo(core_1.Kms.X25519PublicJwk).toJson(),
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
});
|
|
171
|
+
const { data: message } = await kms.decrypt({
|
|
172
|
+
decryption: {
|
|
173
|
+
algorithm: 'C20P',
|
|
174
|
+
iv: core_1.TypedArrayEncoder.fromBase64(encryptedMessage.iv),
|
|
175
|
+
tag: core_1.TypedArrayEncoder.fromBase64(encryptedMessage.tag),
|
|
176
|
+
aad: core_1.TypedArrayEncoder.fromString(encryptedMessage.protected),
|
|
177
|
+
},
|
|
178
|
+
key: {
|
|
179
|
+
privateJwk: {
|
|
180
|
+
kty: 'oct',
|
|
181
|
+
k: core_1.TypedArrayEncoder.toBase64URL(contentEncryptionKey),
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
encrypted: core_1.TypedArrayEncoder.fromBase64(encryptedMessage.ciphertext),
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
plaintextMessage: core_1.JsonEncoder.fromBuffer(message),
|
|
188
|
+
senderKey: senderPublicJwk,
|
|
189
|
+
recipientKey,
|
|
190
|
+
};
|
|
22
191
|
}
|
|
23
192
|
async packMessage(agentContext, payload, keys) {
|
|
24
193
|
const didcommConfig = agentContext.dependencyManager.resolve(DidCommModuleConfig_1.DidCommModuleConfig);
|
|
25
|
-
const {
|
|
26
|
-
let
|
|
27
|
-
const routingKeysBase58 = routingKeys.map((key) => key.publicKeyBase58);
|
|
28
|
-
const senderKeyBase58 = senderKey?.publicKeyBase58;
|
|
194
|
+
const { routingKeys, senderKey } = keys;
|
|
195
|
+
let recipientKeys = keys.recipientKeys;
|
|
29
196
|
// pass whether we want to use legacy did sov prefix
|
|
30
197
|
const message = payload.toJSON({ useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed });
|
|
31
198
|
this.logger.debug(`Pack outbound message ${message['@type']}`);
|
|
32
|
-
let encryptedMessage = await
|
|
199
|
+
let encryptedMessage = await this.encryptDidcommV1Message(agentContext, message, recipientKeys, senderKey);
|
|
33
200
|
// If the message has routing keys (mediator) pack for each mediator
|
|
34
|
-
for (const
|
|
35
|
-
const forwardMessage = new
|
|
201
|
+
for (const routingKey of routingKeys) {
|
|
202
|
+
const forwardMessage = new ForwardMessage_1.ForwardMessage({
|
|
36
203
|
// Forward to first recipient key
|
|
37
|
-
to:
|
|
204
|
+
to: core_1.TypedArrayEncoder.toBase58(recipientKeys[0].publicKey.publicKey),
|
|
38
205
|
message: encryptedMessage,
|
|
39
206
|
});
|
|
40
|
-
|
|
207
|
+
recipientKeys = [routingKey];
|
|
41
208
|
this.logger.debug('Forward message created', forwardMessage);
|
|
42
209
|
const forwardJson = forwardMessage.toJSON({
|
|
43
210
|
useDidSovPrefixWhereAllowed: didcommConfig.useDidSovPrefixWhereAllowed,
|
|
44
211
|
});
|
|
45
212
|
// Forward messages are anon packed
|
|
46
|
-
encryptedMessage = await
|
|
213
|
+
encryptedMessage = await this.encryptDidcommV1Message(agentContext, forwardJson, [routingKey]);
|
|
47
214
|
}
|
|
48
215
|
return encryptedMessage;
|
|
49
216
|
}
|
|
50
217
|
async unpackMessage(agentContext, encryptedMessage) {
|
|
51
|
-
const decryptedMessage = await
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
218
|
+
const decryptedMessage = await this.decryptDidcommV1Message(agentContext, encryptedMessage);
|
|
219
|
+
return decryptedMessage;
|
|
220
|
+
}
|
|
221
|
+
async extractOurRecipientKeyWithKeyId(agentContext, recipient) {
|
|
222
|
+
const kms = agentContext.resolve(core_1.Kms.KeyManagementApi);
|
|
223
|
+
const publicKey = core_1.Kms.PublicJwk.fromPublicKey({
|
|
224
|
+
kty: 'OKP',
|
|
225
|
+
crv: 'Ed25519',
|
|
226
|
+
publicKey: core_1.TypedArrayEncoder.fromBase58(recipient.header.kid),
|
|
227
|
+
});
|
|
228
|
+
// We need to find the associated did based on the recipient key
|
|
229
|
+
// so we can extract the kms key id from the did record.
|
|
230
|
+
try {
|
|
231
|
+
const { didDocument, keys } = await this.didcommDocumentService.resolveCreatedDidDocumentWithKeysByRecipientKey(agentContext, publicKey);
|
|
232
|
+
const verificationMethod = didDocument.findVerificationMethodByPublicKey(publicKey);
|
|
233
|
+
const kmsKeyId = keys?.find(({ didDocumentRelativeKeyId }) => verificationMethod.id.endsWith(didDocumentRelativeKeyId))?.kmsKeyId;
|
|
234
|
+
agentContext.config.logger.debug(`Found did '${didDocument.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`);
|
|
235
|
+
publicKey.keyId = kmsKeyId ?? publicKey.legacyKeyId;
|
|
236
|
+
return publicKey;
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
// If there is no did record yet, we first look at the mediator routing record
|
|
240
|
+
const mediatorRoutingRepository = agentContext.dependencyManager.resolve(MediatorRoutingRepository_1.MediatorRoutingRepository);
|
|
241
|
+
if (error instanceof core_1.RecordNotFoundError) {
|
|
242
|
+
const mediatorRoutingRecord = await mediatorRoutingRepository.findSingleByQuery(agentContext, {
|
|
243
|
+
routingKeyFingerprints: [publicKey.fingerprint],
|
|
244
|
+
});
|
|
245
|
+
if (mediatorRoutingRecord) {
|
|
246
|
+
agentContext.config.logger.debug(`Found mediator routing record with id '${mediatorRoutingRecord.id}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`);
|
|
247
|
+
const routingKey = mediatorRoutingRecord.routingKeysWithKeyId.find((routingKey) => publicKey.equals(routingKey));
|
|
248
|
+
// This should not happen as we only get here if the tag matches
|
|
249
|
+
if (!routingKey) {
|
|
250
|
+
throw new core_1.CredoError(`Expected to find key with fingerprint '${publicKey.fingerprint}' in routing keys of mediator routing record '${mediatorRoutingRecord.id}'`);
|
|
251
|
+
}
|
|
252
|
+
if (routingKey) {
|
|
253
|
+
return routingKey;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// If there is no mediator routing record, we look at the out of band record
|
|
257
|
+
const outOfBandRepository = agentContext.dependencyManager.resolve(OutOfBandRepository_1.OutOfBandRepository);
|
|
258
|
+
const outOfBandRecord = await outOfBandRepository.findSingleByQuery(agentContext, {
|
|
259
|
+
$or: [
|
|
260
|
+
// In case we are the creator of the out of band invitation we can query based on
|
|
261
|
+
// out of band invitation recipient key fingerprint
|
|
262
|
+
{
|
|
263
|
+
role: OutOfBandRole_1.OutOfBandRole.Sender,
|
|
264
|
+
recipientKeyFingerprints: [publicKey.fingerprint],
|
|
265
|
+
},
|
|
266
|
+
// In case we are the receiver of the out of band invitation we need to query
|
|
267
|
+
// for the recipient routing fingerprint
|
|
268
|
+
{
|
|
269
|
+
role: OutOfBandRole_1.OutOfBandRole.Receiver,
|
|
270
|
+
recipientRoutingKeyFingerprint: publicKey.fingerprint,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
});
|
|
274
|
+
if (outOfBandRecord?.role === OutOfBandRole_1.OutOfBandRole.Sender) {
|
|
275
|
+
agentContext.config.logger.debug(`Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`);
|
|
276
|
+
for (const service of outOfBandRecord.outOfBandInvitation.getInlineServices()) {
|
|
277
|
+
const resolvedService = (0, helpers_1.getResolvedDidcommServiceWithSigningKeyId)(service, outOfBandRecord.invitationInlineServiceKeys);
|
|
278
|
+
const _recipientKey = resolvedService.recipientKeys.find((recipientKey) => recipientKey.equals(publicKey));
|
|
279
|
+
if (_recipientKey) {
|
|
280
|
+
return _recipientKey;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else if (outOfBandRecord?.role === OutOfBandRole_1.OutOfBandRole.Receiver) {
|
|
285
|
+
agentContext.config.logger.debug(`Found out of band record with id '${outOfBandRecord.id}' and role '${outOfBandRecord.role}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`);
|
|
286
|
+
// If there is still no key we need to look at the metadata
|
|
287
|
+
const recipieintRouting = outOfBandRecord.metadata.get(outOfBandRecordMetadataTypes_1.OutOfBandRecordMetadataKeys.RecipientRouting);
|
|
288
|
+
if (recipieintRouting?.recipientKeyFingerprint === publicKey.fingerprint) {
|
|
289
|
+
publicKey.keyId = recipieintRouting.recipientKeyId ?? publicKey.legacyKeyId;
|
|
290
|
+
return publicKey;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// If there is no did found, no out of band record found, and not mediator routing record
|
|
294
|
+
// this is either:
|
|
295
|
+
// - a connectionless oob exchange initiated before we added key ids.
|
|
296
|
+
// - a message for a mediator, where the mediator routing record is created before we added key ids
|
|
297
|
+
//
|
|
298
|
+
// We will check if the public key exists based on the base58 encoded public key. We can remove this flow once we create a migration
|
|
299
|
+
// that optimizes this flow.
|
|
300
|
+
const kmsJwkPublic = await kms
|
|
301
|
+
.getPublicKey({
|
|
302
|
+
keyId: publicKey.legacyKeyId,
|
|
303
|
+
})
|
|
304
|
+
.catch((error) => {
|
|
305
|
+
if (error instanceof core_1.Kms.KeyManagementKeyNotFoundError)
|
|
306
|
+
return null;
|
|
307
|
+
throw error;
|
|
308
|
+
});
|
|
309
|
+
if (kmsJwkPublic) {
|
|
310
|
+
agentContext.config.logger.debug(`Found public key with legacy key id '${publicKey.legacyKeyId}' for recipient key '${publicKey.fingerprint}' for incoming didcomm message`);
|
|
311
|
+
publicKey.keyId = publicKey.legacyKeyId;
|
|
312
|
+
return publicKey;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// no match found
|
|
317
|
+
return null;
|
|
58
318
|
}
|
|
59
319
|
};
|
|
60
320
|
exports.EnvelopeService = EnvelopeService;
|
|
61
321
|
exports.EnvelopeService = EnvelopeService = __decorate([
|
|
62
|
-
(0,
|
|
322
|
+
(0, core_2.injectable)(),
|
|
63
323
|
__param(0, (0, core_1.inject)(core_1.InjectionSymbols.Logger)),
|
|
64
|
-
__metadata("design:paramtypes", [Object])
|
|
324
|
+
__metadata("design:paramtypes", [Object, DidCommDocumentService_1.DidCommDocumentService])
|
|
65
325
|
], EnvelopeService);
|
|
66
326
|
//# sourceMappingURL=EnvelopeService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvelopeService.js","sourceRoot":"","sources":["../src/EnvelopeService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,yCAA2F;AAE3F,+DAA2D;AAC3D,yDAA2D;AASpD,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B,YAAoD,MAAc;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,YAA0B,EAC1B,OAAqB,EACrB,IAAkB;QAElB,MAAM,aAAa,GAAG,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,yCAAmB,CAAC,CAAA;QAEjF,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QACtD,IAAI,mBAAmB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QACzE,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QACvE,MAAM,eAAe,GAAG,SAAS,EAAE,eAAe,CAAA;QAElD,oDAAoD;QACpD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,2BAA2B,EAAE,aAAa,CAAC,2BAA2B,EAAE,CAAC,CAAA;QAE1G,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,OAAO,CAAC,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sB;GAJvG,eAAe,CAoZ3B"}
|
package/build/MessageSender.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { EnvelopeKeys } from './EnvelopeService';
|
|
|
3
3
|
import type { ConnectionRecord } from './modules/connections/repository';
|
|
4
4
|
import type { OutboundTransport } from './transport/OutboundTransport';
|
|
5
5
|
import type { EncryptedMessage, OutboundPackage } from './types';
|
|
6
|
-
import { AgentContext,
|
|
6
|
+
import { AgentContext, EventEmitter } from '@credo-ts/core';
|
|
7
|
+
import { DidCommModuleConfig } from './DidCommModuleConfig';
|
|
7
8
|
import { EnvelopeService } from './EnvelopeService';
|
|
8
9
|
import { TransportService } from './TransportService';
|
|
9
10
|
import { DID_COMM_TRANSPORT_QUEUE } from './constants';
|
|
10
11
|
import { OutboundMessageContext } from './models';
|
|
11
|
-
import { MessagePickupRepository } from './modules/message-pickup/storage';
|
|
12
12
|
import { DidCommDocumentService } from './services/DidCommDocumentService';
|
|
13
13
|
export interface TransportPriorityOptions {
|
|
14
14
|
schemes: string[];
|
|
@@ -17,13 +17,11 @@ export interface TransportPriorityOptions {
|
|
|
17
17
|
export declare class MessageSender {
|
|
18
18
|
private envelopeService;
|
|
19
19
|
private transportService;
|
|
20
|
-
private
|
|
21
|
-
private logger;
|
|
22
|
-
private didResolverService;
|
|
20
|
+
private queueTransportRepository;
|
|
23
21
|
private didCommDocumentService;
|
|
24
22
|
private eventEmitter;
|
|
25
23
|
private _outboundTransports;
|
|
26
|
-
constructor(envelopeService: EnvelopeService, transportService: TransportService,
|
|
24
|
+
constructor(envelopeService: EnvelopeService, transportService: TransportService, didCommModuleConfig: DidCommModuleConfig, didCommDocumentService: DidCommDocumentService, eventEmitter: EventEmitter);
|
|
27
25
|
get outboundTransports(): OutboundTransport[];
|
|
28
26
|
registerOutboundTransport(outboundTransport: OutboundTransport): void;
|
|
29
27
|
unregisterOutboundTransport(outboundTransport: OutboundTransport): Promise<void>;
|