@veridid/signing 0.0.0-stage → 1.0.0
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 +39 -2
- package/build/SigningApi.d.mts +368 -0
- package/build/SigningApi.d.mts.map +1 -0
- package/build/SigningApi.mjs +516 -0
- package/build/SigningApi.mjs.map +1 -0
- package/build/SigningEvents.d.mts +71 -0
- package/build/SigningEvents.d.mts.map +1 -0
- package/build/SigningEvents.mjs +16 -0
- package/build/SigningEvents.mjs.map +1 -0
- package/build/SigningModule.d.mts +42 -0
- package/build/SigningModule.d.mts.map +1 -0
- package/build/SigningModule.mjs +91 -0
- package/build/SigningModule.mjs.map +1 -0
- package/build/SigningRole.d.mts +25 -0
- package/build/SigningRole.d.mts.map +1 -0
- package/build/SigningRole.mjs +27 -0
- package/build/SigningRole.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.112.0/helpers/decorateParam.mjs +9 -0
- package/build/compat.d.mts +24 -0
- package/build/compat.d.mts.map +1 -0
- package/build/compat.mjs +26 -0
- package/build/compat.mjs.map +1 -0
- package/build/delivery/ArtifactDeliveryStrategy.d.mts +74 -0
- package/build/delivery/ArtifactDeliveryStrategy.d.mts.map +1 -0
- package/build/delivery/InlineBase64Strategy.d.mts +50 -0
- package/build/delivery/InlineBase64Strategy.d.mts.map +1 -0
- package/build/delivery/InlineBase64Strategy.mjs +80 -0
- package/build/delivery/InlineBase64Strategy.mjs.map +1 -0
- package/build/delivery/index.mjs +1 -0
- package/build/errors/ArtifactTooLargeError.d.mts +12 -0
- package/build/errors/ArtifactTooLargeError.d.mts.map +1 -0
- package/build/errors/ArtifactTooLargeError.mjs +15 -0
- package/build/errors/ArtifactTooLargeError.mjs.map +1 -0
- package/build/errors/DigestMismatchError.d.mts +12 -0
- package/build/errors/DigestMismatchError.d.mts.map +1 -0
- package/build/errors/DigestMismatchError.mjs +15 -0
- package/build/errors/DigestMismatchError.mjs.map +1 -0
- package/build/errors/IdempotencyConflictError.d.mts +12 -0
- package/build/errors/IdempotencyConflictError.d.mts.map +1 -0
- package/build/errors/IdempotencyConflictError.mjs +15 -0
- package/build/errors/IdempotencyConflictError.mjs.map +1 -0
- package/build/errors/InvalidStateError.d.mts +14 -0
- package/build/errors/InvalidStateError.d.mts.map +1 -0
- package/build/errors/InvalidStateError.mjs +16 -0
- package/build/errors/InvalidStateError.mjs.map +1 -0
- package/build/errors/PolicyEnforcementError.d.mts +12 -0
- package/build/errors/PolicyEnforcementError.d.mts.map +1 -0
- package/build/errors/PolicyEnforcementError.mjs +15 -0
- package/build/errors/PolicyEnforcementError.mjs.map +1 -0
- package/build/errors/SigningError.d.mts +16 -0
- package/build/errors/SigningError.d.mts.map +1 -0
- package/build/errors/SigningError.mjs +16 -0
- package/build/errors/SigningError.mjs.map +1 -0
- package/build/errors/ThresholdNotMetError.d.mts +12 -0
- package/build/errors/ThresholdNotMetError.d.mts.map +1 -0
- package/build/errors/ThresholdNotMetError.mjs +15 -0
- package/build/errors/ThresholdNotMetError.mjs.map +1 -0
- package/build/errors/UnsupportedCanonicalizerError.d.mts +12 -0
- package/build/errors/UnsupportedCanonicalizerError.d.mts.map +1 -0
- package/build/errors/UnsupportedCanonicalizerError.mjs +16 -0
- package/build/errors/UnsupportedCanonicalizerError.mjs.map +1 -0
- package/build/errors/UnsupportedSuiteError.d.mts +12 -0
- package/build/errors/UnsupportedSuiteError.d.mts.map +1 -0
- package/build/errors/UnsupportedSuiteError.mjs +16 -0
- package/build/errors/UnsupportedSuiteError.mjs.map +1 -0
- package/build/errors/index.d.mts +9 -0
- package/build/errors/index.mjs +9 -0
- package/build/handlers/CombineMessageHandler.d.mts +22 -0
- package/build/handlers/CombineMessageHandler.d.mts.map +1 -0
- package/build/handlers/CombineMessageHandler.mjs +25 -0
- package/build/handlers/CombineMessageHandler.mjs.map +1 -0
- package/build/handlers/ConsentMessageHandler.d.mts +19 -0
- package/build/handlers/ConsentMessageHandler.d.mts.map +1 -0
- package/build/handlers/ConsentMessageHandler.mjs +21 -0
- package/build/handlers/ConsentMessageHandler.mjs.map +1 -0
- package/build/handlers/DeclineMessageHandler.d.mts +19 -0
- package/build/handlers/DeclineMessageHandler.d.mts.map +1 -0
- package/build/handlers/DeclineMessageHandler.mjs +21 -0
- package/build/handlers/DeclineMessageHandler.mjs.map +1 -0
- package/build/handlers/PartialSignatureMessageHandler.d.mts +19 -0
- package/build/handlers/PartialSignatureMessageHandler.d.mts.map +1 -0
- package/build/handlers/PartialSignatureMessageHandler.mjs +21 -0
- package/build/handlers/PartialSignatureMessageHandler.mjs.map +1 -0
- package/build/handlers/ProposeSigningMessageHandler.d.mts +19 -0
- package/build/handlers/ProposeSigningMessageHandler.d.mts.map +1 -0
- package/build/handlers/ProposeSigningMessageHandler.mjs +21 -0
- package/build/handlers/ProposeSigningMessageHandler.mjs.map +1 -0
- package/build/handlers/ProvideArtifactsMessageHandler.d.mts +19 -0
- package/build/handlers/ProvideArtifactsMessageHandler.d.mts.map +1 -0
- package/build/handlers/ProvideArtifactsMessageHandler.mjs +21 -0
- package/build/handlers/ProvideArtifactsMessageHandler.mjs.map +1 -0
- package/build/handlers/RequestSigningMessageHandler.d.mts +19 -0
- package/build/handlers/RequestSigningMessageHandler.d.mts.map +1 -0
- package/build/handlers/RequestSigningMessageHandler.mjs +21 -0
- package/build/handlers/RequestSigningMessageHandler.mjs.map +1 -0
- package/build/handlers/SigningAckMessageHandler.d.mts +22 -0
- package/build/handlers/SigningAckMessageHandler.d.mts.map +1 -0
- package/build/handlers/SigningAckMessageHandler.mjs +25 -0
- package/build/handlers/SigningAckMessageHandler.mjs.map +1 -0
- package/build/handlers/SigningProblemReportMessageHandler.d.mts +19 -0
- package/build/handlers/SigningProblemReportMessageHandler.d.mts.map +1 -0
- package/build/handlers/SigningProblemReportMessageHandler.mjs +21 -0
- package/build/handlers/SigningProblemReportMessageHandler.mjs.map +1 -0
- package/build/handlers/index.d.mts +9 -0
- package/build/handlers/index.mjs +9 -0
- package/build/index.d.mts +75 -0
- package/build/index.mjs +63 -0
- package/build/messages/CombineMessage.d.mts +32 -0
- package/build/messages/CombineMessage.d.mts.map +1 -0
- package/build/messages/CombineMessage.mjs +47 -0
- package/build/messages/CombineMessage.mjs.map +1 -0
- package/build/messages/ConsentMessage.d.mts +32 -0
- package/build/messages/ConsentMessage.d.mts.map +1 -0
- package/build/messages/ConsentMessage.mjs +46 -0
- package/build/messages/ConsentMessage.mjs.map +1 -0
- package/build/messages/DeclineMessage.d.mts +26 -0
- package/build/messages/DeclineMessage.d.mts.map +1 -0
- package/build/messages/DeclineMessage.mjs +47 -0
- package/build/messages/DeclineMessage.mjs.map +1 -0
- package/build/messages/PartialSignatureMessage.d.mts +36 -0
- package/build/messages/PartialSignatureMessage.d.mts.map +1 -0
- package/build/messages/PartialSignatureMessage.mjs +72 -0
- package/build/messages/PartialSignatureMessage.mjs.map +1 -0
- package/build/messages/ProposeSigningMessage.d.mts +27 -0
- package/build/messages/ProposeSigningMessage.d.mts.map +1 -0
- package/build/messages/ProposeSigningMessage.mjs +41 -0
- package/build/messages/ProposeSigningMessage.mjs.map +1 -0
- package/build/messages/ProvideArtifactsMessage.d.mts +62 -0
- package/build/messages/ProvideArtifactsMessage.d.mts.map +1 -0
- package/build/messages/ProvideArtifactsMessage.mjs +40 -0
- package/build/messages/ProvideArtifactsMessage.mjs.map +1 -0
- package/build/messages/RequestSigningMessage.d.mts +38 -0
- package/build/messages/RequestSigningMessage.d.mts.map +1 -0
- package/build/messages/RequestSigningMessage.mjs +62 -0
- package/build/messages/RequestSigningMessage.mjs.map +1 -0
- package/build/messages/SigningAckMessage.d.mts +26 -0
- package/build/messages/SigningAckMessage.d.mts.map +1 -0
- package/build/messages/SigningAckMessage.mjs +46 -0
- package/build/messages/SigningAckMessage.mjs.map +1 -0
- package/build/messages/SigningProblemReportMessage.d.mts +44 -0
- package/build/messages/SigningProblemReportMessage.d.mts.map +1 -0
- package/build/messages/SigningProblemReportMessage.mjs +65 -0
- package/build/messages/SigningProblemReportMessage.mjs.map +1 -0
- package/build/messages/index.d.mts +9 -0
- package/build/messages/index.mjs +9 -0
- package/build/models/AggregationResult.d.mts +85 -0
- package/build/models/AggregationResult.d.mts.map +1 -0
- package/build/models/ArtifactMetadata.d.mts +37 -0
- package/build/models/ArtifactMetadata.d.mts.map +1 -0
- package/build/models/AuthzArtifact.d.mts +178 -0
- package/build/models/AuthzArtifact.d.mts.map +1 -0
- package/build/models/Capabilities.d.mts +109 -0
- package/build/models/Capabilities.d.mts.map +1 -0
- package/build/models/JoinToken.d.mts +344 -0
- package/build/models/JoinToken.d.mts.map +1 -0
- package/build/models/JoinToken.mjs +14 -0
- package/build/models/JoinToken.mjs.map +1 -0
- package/build/models/PartialSignature.d.mts +82 -0
- package/build/models/PartialSignature.d.mts.map +1 -0
- package/build/models/PolicyContext.d.mts +55 -0
- package/build/models/PolicyContext.d.mts.map +1 -0
- package/build/models/RouterAttestation.d.mts +186 -0
- package/build/models/RouterAttestation.d.mts.map +1 -0
- package/build/models/Session.d.mts +62 -0
- package/build/models/Session.d.mts.map +1 -0
- package/build/models/Session.mjs +19 -0
- package/build/models/Session.mjs.map +1 -0
- package/build/models/SignableObject.d.mts +71 -0
- package/build/models/SignableObject.d.mts.map +1 -0
- package/build/models/SigningState.d.mts +21 -0
- package/build/models/SigningState.d.mts.map +1 -0
- package/build/models/SigningState.mjs +23 -0
- package/build/models/SigningState.mjs.map +1 -0
- package/build/models/Suite.d.mts +59 -0
- package/build/models/Suite.d.mts.map +1 -0
- package/build/models/index.d.mts +12 -0
- package/build/pdf/PdfUtils.d.mts +160 -0
- package/build/pdf/PdfUtils.d.mts.map +1 -0
- package/build/pdf/PdfUtils.mjs +283 -0
- package/build/pdf/PdfUtils.mjs.map +1 -0
- package/build/pdf/index.mjs +1 -0
- package/build/registry/aggregators/Aggregator.d.mts +85 -0
- package/build/registry/aggregators/Aggregator.d.mts.map +1 -0
- package/build/registry/aggregators/AggregatorRegistry.d.mts +55 -0
- package/build/registry/aggregators/AggregatorRegistry.d.mts.map +1 -0
- package/build/registry/aggregators/AggregatorRegistry.mjs +76 -0
- package/build/registry/aggregators/AggregatorRegistry.mjs.map +1 -0
- package/build/registry/aggregators/BundleNoneAggregator.d.mts +43 -0
- package/build/registry/aggregators/BundleNoneAggregator.d.mts.map +1 -0
- package/build/registry/aggregators/BundleNoneAggregator.mjs +65 -0
- package/build/registry/aggregators/BundleNoneAggregator.mjs.map +1 -0
- package/build/registry/aggregators/index.d.mts +3 -0
- package/build/registry/aggregators/index.mjs +2 -0
- package/build/registry/canonicalizers/Canonicalizer.d.mts +67 -0
- package/build/registry/canonicalizers/Canonicalizer.d.mts.map +1 -0
- package/build/registry/canonicalizers/CanonicalizerRegistry.d.mts +55 -0
- package/build/registry/canonicalizers/CanonicalizerRegistry.d.mts.map +1 -0
- package/build/registry/canonicalizers/CanonicalizerRegistry.mjs +78 -0
- package/build/registry/canonicalizers/CanonicalizerRegistry.mjs.map +1 -0
- package/build/registry/canonicalizers/PdfIncrementalUpdateCanonicalizer.d.mts +126 -0
- package/build/registry/canonicalizers/PdfIncrementalUpdateCanonicalizer.d.mts.map +1 -0
- package/build/registry/canonicalizers/PdfIncrementalUpdateCanonicalizer.mjs +143 -0
- package/build/registry/canonicalizers/PdfIncrementalUpdateCanonicalizer.mjs.map +1 -0
- package/build/registry/canonicalizers/RawBytesCanonicalizer.d.mts +34 -0
- package/build/registry/canonicalizers/RawBytesCanonicalizer.d.mts.map +1 -0
- package/build/registry/canonicalizers/RawBytesCanonicalizer.mjs +55 -0
- package/build/registry/canonicalizers/RawBytesCanonicalizer.mjs.map +1 -0
- package/build/registry/canonicalizers/index.d.mts +4 -0
- package/build/registry/canonicalizers/index.mjs +3 -0
- package/build/registry/index.d.mts +18 -0
- package/build/registry/index.mjs +14 -0
- package/build/registry/policies/Policy.d.mts +62 -0
- package/build/registry/policies/Policy.d.mts.map +1 -0
- package/build/registry/policies/PolicyRegistry.d.mts +54 -0
- package/build/registry/policies/PolicyRegistry.d.mts.map +1 -0
- package/build/registry/policies/PolicyRegistry.mjs +73 -0
- package/build/registry/policies/PolicyRegistry.mjs.map +1 -0
- package/build/registry/policies/TimeWindowPolicy.d.mts +85 -0
- package/build/registry/policies/TimeWindowPolicy.d.mts.map +1 -0
- package/build/registry/policies/TimeWindowPolicy.mjs +111 -0
- package/build/registry/policies/TimeWindowPolicy.mjs.map +1 -0
- package/build/registry/policies/index.d.mts +3 -0
- package/build/registry/policies/index.mjs +2 -0
- package/build/registry/suites/JwsEd25519Suite.d.mts +47 -0
- package/build/registry/suites/JwsEd25519Suite.d.mts.map +1 -0
- package/build/registry/suites/JwsEd25519Suite.mjs +101 -0
- package/build/registry/suites/JwsEd25519Suite.mjs.map +1 -0
- package/build/registry/suites/PadesBLtaSuite.d.mts +106 -0
- package/build/registry/suites/PadesBLtaSuite.d.mts.map +1 -0
- package/build/registry/suites/PadesBLtaSuite.mjs +122 -0
- package/build/registry/suites/PadesBLtaSuite.mjs.map +1 -0
- package/build/registry/suites/SignatureSuite.d.mts +128 -0
- package/build/registry/suites/SignatureSuite.d.mts.map +1 -0
- package/build/registry/suites/SignatureSuiteRegistry.d.mts +62 -0
- package/build/registry/suites/SignatureSuiteRegistry.d.mts.map +1 -0
- package/build/registry/suites/SignatureSuiteRegistry.mjs +87 -0
- package/build/registry/suites/SignatureSuiteRegistry.mjs.map +1 -0
- package/build/registry/suites/index.d.mts +4 -0
- package/build/registry/suites/index.mjs +3 -0
- package/build/repository/CounterRecord.d.mts +84 -0
- package/build/repository/CounterRecord.d.mts.map +1 -0
- package/build/repository/CounterRecord.mjs +82 -0
- package/build/repository/CounterRecord.mjs.map +1 -0
- package/build/repository/CounterRepository.d.mts +22 -0
- package/build/repository/CounterRepository.d.mts.map +1 -0
- package/build/repository/CounterRepository.mjs +51 -0
- package/build/repository/CounterRepository.mjs.map +1 -0
- package/build/repository/SigningSessionRecord.d.mts +102 -0
- package/build/repository/SigningSessionRecord.d.mts.map +1 -0
- package/build/repository/SigningSessionRecord.mjs +96 -0
- package/build/repository/SigningSessionRecord.mjs.map +1 -0
- package/build/repository/SigningSessionRepository.d.mts +30 -0
- package/build/repository/SigningSessionRepository.d.mts.map +1 -0
- package/build/repository/SigningSessionRepository.mjs +52 -0
- package/build/repository/SigningSessionRepository.mjs.map +1 -0
- package/build/repository/index.d.mts +4 -0
- package/build/repository/index.mjs +4 -0
- package/build/services/CounterService.d.mts +121 -0
- package/build/services/CounterService.d.mts.map +1 -0
- package/build/services/CounterService.mjs +176 -0
- package/build/services/CounterService.mjs.map +1 -0
- package/build/services/HPKEService.d.mts +174 -0
- package/build/services/HPKEService.d.mts.map +1 -0
- package/build/services/HPKEService.mjs +195 -0
- package/build/services/HPKEService.mjs.map +1 -0
- package/build/services/SigningService.d.mts +387 -0
- package/build/services/SigningService.d.mts.map +1 -0
- package/build/services/SigningService.mjs +1104 -0
- package/build/services/SigningService.mjs.map +1 -0
- package/build/services/index.d.mts +3 -0
- package/build/services/index.mjs +3 -0
- package/package.json +44 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2020-present Hyperledger Contributors.
|
|
190
|
+
Copyright 2021 Queen’s Printer for Ontario. Mostafa Youssef (https://github.com/MosCD3), Amit Padmani (https://github.com/nbAmit), Prasad Katkar (https://github.com/NB-PrasadKatkar), Mike Richardson (https://github.com/NB-MikeRichardson)
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @veridid/signing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
DIDComm signing protocol for Credo: request, collect and verify signatures over documents and data.
|
|
4
|
+
|
|
5
|
+
Part of the VeriDID Credo modules. Version 1.x targets Credo `0.7.x`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add @veridid/signing @credo-ts/core@^0.7 @credo-ts/didcomm@^0.7
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer dependencies
|
|
14
|
+
|
|
15
|
+
- `@credo-ts/core` `>=0.7.0 <0.8`
|
|
16
|
+
- `@credo-ts/didcomm` `>=0.7.0 <0.8`
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Agent } from '@credo-ts/core'
|
|
22
|
+
import { agentDependencies } from '@credo-ts/node' // or @credo-ts/react-native
|
|
23
|
+
import { SigningModule } from '@veridid/signing'
|
|
24
|
+
|
|
25
|
+
const agent = new Agent({
|
|
26
|
+
config: { /* … */ },
|
|
27
|
+
dependencies: agentDependencies,
|
|
28
|
+
modules: {
|
|
29
|
+
// …your other modules (didcomm, connections, …)
|
|
30
|
+
signing: new SigningModule(),
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
await agent.initialize()
|
|
35
|
+
// The module API is available as agent.modules.signing
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
Apache-2.0
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { SignableObject } from "./models/SignableObject.mjs";
|
|
2
|
+
import { Session } from "./models/Session.mjs";
|
|
3
|
+
import { SuiteConfig } from "./models/Suite.mjs";
|
|
4
|
+
import { AuthzVerificationResult, CreateAuthzArtifactOptions, SigningAuthz, VerifyAuthzArtifactOptions } from "./models/AuthzArtifact.mjs";
|
|
5
|
+
import { CreateJoinTokenOptions, JoinToken, JoinTokenVerificationResult, VerifyJoinTokenOptions } from "./models/JoinToken.mjs";
|
|
6
|
+
import { CreateRouterAttestationOptions, RouterAttestation, RouterAttestationVerificationResult, VerifyRouterAttestationOptions } from "./models/RouterAttestation.mjs";
|
|
7
|
+
import "./models/index.mjs";
|
|
8
|
+
import { SigningSessionRecord } from "./repository/SigningSessionRecord.mjs";
|
|
9
|
+
import "./repository/index.mjs";
|
|
10
|
+
import { SigningService } from "./services/SigningService.mjs";
|
|
11
|
+
import "./services/index.mjs";
|
|
12
|
+
import { AgentContext, Query, QueryOptions } from "@credo-ts/core";
|
|
13
|
+
import { DidCommConnectionService, DidCommMessageHandlerRegistry, DidCommMessageSender } from "@credo-ts/didcomm";
|
|
14
|
+
|
|
15
|
+
//#region src/SigningApi.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Public API for the DIDComm Signing Protocol
|
|
18
|
+
*
|
|
19
|
+
* This API provides methods for applications to interact with the signing protocol,
|
|
20
|
+
* including initiating signing sessions, responding to requests, and managing signatures.
|
|
21
|
+
*/
|
|
22
|
+
declare class SigningApi {
|
|
23
|
+
private signingService;
|
|
24
|
+
private messageSender;
|
|
25
|
+
private connectionService;
|
|
26
|
+
private agentContext;
|
|
27
|
+
constructor(messageHandlerRegistry: DidCommMessageHandlerRegistry, signingService: SigningService, messageSender: DidCommMessageSender, connectionService: DidCommConnectionService, agentContext: AgentContext);
|
|
28
|
+
/**
|
|
29
|
+
* Register all protocol message handlers
|
|
30
|
+
*/
|
|
31
|
+
private registerMessageHandlers;
|
|
32
|
+
/**
|
|
33
|
+
* Propose capabilities to a signer
|
|
34
|
+
*
|
|
35
|
+
* Used by requesters to discover what signing capabilities a signer supports
|
|
36
|
+
* before initiating an actual signing request.
|
|
37
|
+
*
|
|
38
|
+
* @param connectionId - Connection to send the proposal to
|
|
39
|
+
* @param options - Optional session configuration
|
|
40
|
+
* @returns The created session record
|
|
41
|
+
*/
|
|
42
|
+
proposeCapabilities(connectionId: string, options?: {
|
|
43
|
+
session?: Session;
|
|
44
|
+
}): Promise<SigningSessionRecord>;
|
|
45
|
+
/**
|
|
46
|
+
* Request signing of an object
|
|
47
|
+
*
|
|
48
|
+
* Used by requesters to ask a signer to sign a specific object using
|
|
49
|
+
* a particular signature suite.
|
|
50
|
+
*
|
|
51
|
+
* @param connectionId - Connection to send the request to
|
|
52
|
+
* @param config - Signing request configuration
|
|
53
|
+
* @returns The created session record
|
|
54
|
+
*/
|
|
55
|
+
requestSigning(connectionId: string, config: {
|
|
56
|
+
object: SignableObject;
|
|
57
|
+
suite: SuiteConfig;
|
|
58
|
+
session?: Session;
|
|
59
|
+
threshold?: number;
|
|
60
|
+
signers?: string[];
|
|
61
|
+
idempotencyKey?: string;
|
|
62
|
+
ui?: {
|
|
63
|
+
mustDisplaySummary?: boolean;
|
|
64
|
+
};
|
|
65
|
+
}): Promise<SigningSessionRecord>;
|
|
66
|
+
/**
|
|
67
|
+
* Consent to sign an object
|
|
68
|
+
*
|
|
69
|
+
* Used by signers to agree to sign an object and provide a key binding proof.
|
|
70
|
+
*
|
|
71
|
+
* @param sessionId - The signing session ID
|
|
72
|
+
* @param config - Consent configuration
|
|
73
|
+
* @returns The updated session record
|
|
74
|
+
*/
|
|
75
|
+
consentToSign(sessionId: string, config: {
|
|
76
|
+
objectId: string;
|
|
77
|
+
keyId: string;
|
|
78
|
+
}): Promise<SigningSessionRecord>;
|
|
79
|
+
/**
|
|
80
|
+
* Sign an object
|
|
81
|
+
*
|
|
82
|
+
* Used by signers to create a signature over an object.
|
|
83
|
+
*
|
|
84
|
+
* @param sessionId - The signing session ID
|
|
85
|
+
* @param config - Signing configuration
|
|
86
|
+
* @returns The updated session record
|
|
87
|
+
*/
|
|
88
|
+
sign(sessionId: string, config: {
|
|
89
|
+
objectId: string;
|
|
90
|
+
keyId: string;
|
|
91
|
+
}): Promise<SigningSessionRecord>;
|
|
92
|
+
/**
|
|
93
|
+
* Provide final signed artifacts
|
|
94
|
+
*
|
|
95
|
+
* Used by requesters to deliver the final signed artifacts (e.g., signed PDFs)
|
|
96
|
+
* back to signers.
|
|
97
|
+
*
|
|
98
|
+
* @param sessionId - The signing session ID
|
|
99
|
+
* @param config - Optional artifact configuration
|
|
100
|
+
* @returns The updated session record
|
|
101
|
+
*/
|
|
102
|
+
provideFinalArtifacts(sessionId: string, config?: {
|
|
103
|
+
artifactData?: Uint8Array;
|
|
104
|
+
artifactMimeType?: string;
|
|
105
|
+
}): Promise<SigningSessionRecord>;
|
|
106
|
+
/**
|
|
107
|
+
* Decline a signing request
|
|
108
|
+
*
|
|
109
|
+
* Used by signers to reject a signing request with a reason.
|
|
110
|
+
*
|
|
111
|
+
* @param sessionId - The signing session ID
|
|
112
|
+
* @param reason - Reason for declining
|
|
113
|
+
* @returns The updated session record
|
|
114
|
+
*/
|
|
115
|
+
decline(sessionId: string, reason: string): Promise<SigningSessionRecord>;
|
|
116
|
+
/**
|
|
117
|
+
* Abandon a signing session
|
|
118
|
+
*
|
|
119
|
+
* Used by either party to abandon a signing session due to an error or timeout.
|
|
120
|
+
*
|
|
121
|
+
* @param sessionId - The signing session ID
|
|
122
|
+
* @param config - Abandonment configuration
|
|
123
|
+
* @returns The updated session record
|
|
124
|
+
*/
|
|
125
|
+
abandon(sessionId: string, config: {
|
|
126
|
+
code: string;
|
|
127
|
+
explain?: string;
|
|
128
|
+
}): Promise<SigningSessionRecord>;
|
|
129
|
+
/**
|
|
130
|
+
* Get a signing session by ID
|
|
131
|
+
*
|
|
132
|
+
* @param sessionId - The signing session ID
|
|
133
|
+
* @returns The session record or null if not found
|
|
134
|
+
*/
|
|
135
|
+
getById(sessionId: string): Promise<SigningSessionRecord | null>;
|
|
136
|
+
/**
|
|
137
|
+
* Get all signing sessions
|
|
138
|
+
*
|
|
139
|
+
* @returns All session records
|
|
140
|
+
*/
|
|
141
|
+
getAll(): Promise<SigningSessionRecord[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Find signing sessions by query
|
|
144
|
+
*
|
|
145
|
+
* @param query - Query parameters
|
|
146
|
+
* @param queryOptions - Query options
|
|
147
|
+
* @returns Matching session records
|
|
148
|
+
*/
|
|
149
|
+
findAllByQuery(query: Query<SigningSessionRecord>, queryOptions?: QueryOptions): Promise<SigningSessionRecord[]>;
|
|
150
|
+
/**
|
|
151
|
+
* Create an authorization artifact for Group Messaging Protocol
|
|
152
|
+
*
|
|
153
|
+
* Creates a signed authorization artifact that proves admin approval for
|
|
154
|
+
* privileged operations (invite, moderate, update).
|
|
155
|
+
*
|
|
156
|
+
* @param options - Authorization artifact options
|
|
157
|
+
* @returns Authorization artifact with signatures
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* const authz = await agent.modules.signing.createAuthzArtifact({
|
|
162
|
+
* action: 'invite',
|
|
163
|
+
* roomDid: 'did:peer:room123',
|
|
164
|
+
* targetDid: 'did:ex:alice',
|
|
165
|
+
* adminDids: ['did:ex:admin1', 'did:ex:admin2'],
|
|
166
|
+
* threshold: 2,
|
|
167
|
+
* payload: { room: 'did:peer:room123', invitee: 'did:ex:alice' }
|
|
168
|
+
* })
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
createAuthzArtifact(options: CreateAuthzArtifactOptions): Promise<SigningAuthz>;
|
|
172
|
+
/**
|
|
173
|
+
* Verify an authorization artifact
|
|
174
|
+
*
|
|
175
|
+
* Verifies that an authorization artifact has valid signatures from
|
|
176
|
+
* authorized admins and meets threshold requirements.
|
|
177
|
+
*
|
|
178
|
+
* @param authz - Authorization artifact to verify
|
|
179
|
+
* @param options - Verification options
|
|
180
|
+
* @returns Verification result with validity and details
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* const result = await agent.modules.signing.verifyAuthzArtifact(authz, {
|
|
185
|
+
* roomDid: 'did:peer:room123',
|
|
186
|
+
* requiredAction: 'invite',
|
|
187
|
+
* allowedAdmins: ['did:ex:admin1', 'did:ex:admin2'],
|
|
188
|
+
* threshold: 2
|
|
189
|
+
* })
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
verifyAuthzArtifact(authz: SigningAuthz, options: VerifyAuthzArtifactOptions): Promise<AuthzVerificationResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Create a simple authorization request (alias for createAuthzArtifact)
|
|
195
|
+
*
|
|
196
|
+
* Simplified API for creating authorization artifacts with a more intuitive interface.
|
|
197
|
+
*
|
|
198
|
+
* @param options - Authorization request options
|
|
199
|
+
* @returns Authorization artifact
|
|
200
|
+
*/
|
|
201
|
+
createRequest(options: {
|
|
202
|
+
signer: string;
|
|
203
|
+
subject: string;
|
|
204
|
+
action: string;
|
|
205
|
+
resource: string;
|
|
206
|
+
context?: Record<string, unknown>;
|
|
207
|
+
expiresAt?: Date;
|
|
208
|
+
}): Promise<{
|
|
209
|
+
artifact: SigningAuthz;
|
|
210
|
+
}>;
|
|
211
|
+
/**
|
|
212
|
+
* Create a join token with HPKE envelope
|
|
213
|
+
*
|
|
214
|
+
* Creates a replay-proof join token for secure room invitations with:
|
|
215
|
+
* - Signed authorization ticket with monotonic counter
|
|
216
|
+
* - HPKE-encrypted payload (e.g., MLS Welcome message)
|
|
217
|
+
* - AAD binding to prevent envelope transplant attacks
|
|
218
|
+
*
|
|
219
|
+
* Used by Group Messaging Protocol for secure room invitations.
|
|
220
|
+
*
|
|
221
|
+
* @param options - Join token creation options
|
|
222
|
+
* @returns Complete join token ready for transmission
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* // Generate device key pair for HPKE
|
|
227
|
+
* const { publicKey, privateKey } = await hpkeService.generateKeyPair()
|
|
228
|
+
*
|
|
229
|
+
* // Create join token
|
|
230
|
+
* const joinToken = await agent.modules.signing.createJoinToken({
|
|
231
|
+
* sessionId: 'session_abc123',
|
|
232
|
+
* deviceDid: 'did:ex:alice#device1',
|
|
233
|
+
* devicePublicKey: publicKey,
|
|
234
|
+
* payload: { welcome: mlsWelcomeMessage, groupInfo: ... },
|
|
235
|
+
* expiresIn: 120,
|
|
236
|
+
* capacity: 1,
|
|
237
|
+
* scope: 'join'
|
|
238
|
+
* })
|
|
239
|
+
*
|
|
240
|
+
* // Send join token to invitee via DIDComm
|
|
241
|
+
* await agent.dids.sendMessage({
|
|
242
|
+
* to: 'did:ex:alice',
|
|
243
|
+
* body: { joinToken }
|
|
244
|
+
* })
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
createJoinToken(options: CreateJoinTokenOptions): Promise<JoinToken>;
|
|
248
|
+
/**
|
|
249
|
+
* Verify and decrypt a join token
|
|
250
|
+
*
|
|
251
|
+
* Verifies a join token by:
|
|
252
|
+
* 1. Verifying the ticket signature
|
|
253
|
+
* 2. Checking counter for replay attacks
|
|
254
|
+
* 3. Verifying expiry
|
|
255
|
+
* 4. Checking AAD binding
|
|
256
|
+
* 5. Decrypting the envelope with device private key
|
|
257
|
+
*
|
|
258
|
+
* CRITICAL: Counter is persisted BEFORE token consumption to prevent
|
|
259
|
+
* replay attacks even if consumption fails.
|
|
260
|
+
*
|
|
261
|
+
* @param joinToken - Join token to verify
|
|
262
|
+
* @param options - Verification options
|
|
263
|
+
* @returns Verification result with decrypted payload
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```typescript
|
|
267
|
+
* // Receive join token from coordinator
|
|
268
|
+
* const joinToken = message.body.joinToken
|
|
269
|
+
*
|
|
270
|
+
* // Verify and decrypt
|
|
271
|
+
* const result = await agent.modules.signing.verifyJoinToken(joinToken, {
|
|
272
|
+
* devicePrivateKey: myX25519PrivateKey,
|
|
273
|
+
* enforceExpiry: true,
|
|
274
|
+
* enforceCounter: true,
|
|
275
|
+
* expectedCoordinator: 'did:ex:coordinator'
|
|
276
|
+
* })
|
|
277
|
+
*
|
|
278
|
+
* if (result.valid) {
|
|
279
|
+
* const { welcome, groupInfo } = result.payload
|
|
280
|
+
* // Process MLS Welcome message and join room
|
|
281
|
+
* await mlsClient.processWelcome(welcome)
|
|
282
|
+
* } else {
|
|
283
|
+
* console.error('Invalid join token:', result.reason)
|
|
284
|
+
* }
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
verifyJoinToken(joinToken: JoinToken, options: VerifyJoinTokenOptions): Promise<JoinTokenVerificationResult>;
|
|
288
|
+
/**
|
|
289
|
+
* Create a router attestation for Group Messaging Protocol
|
|
290
|
+
*
|
|
291
|
+
* Creates a signed attestation that proves a router is authorized to relay
|
|
292
|
+
* messages for a room to a specific reach set of DIDs.
|
|
293
|
+
*
|
|
294
|
+
* Security Properties:
|
|
295
|
+
* - Router identity binding via DID signature
|
|
296
|
+
* - Room-specific authorization
|
|
297
|
+
* - Time-bounded validity (expiry)
|
|
298
|
+
* - Optional admin co-signature for additional trust
|
|
299
|
+
*
|
|
300
|
+
* @param options - Router attestation options
|
|
301
|
+
* @returns Router attestation with signature(s)
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```typescript
|
|
305
|
+
* // Router creates attestation for room
|
|
306
|
+
* const attestation = await agent.modules.signing.createRouterAttestation({
|
|
307
|
+
* routerDid: 'did:ex:router1',
|
|
308
|
+
* roomDid: 'did:peer:room123',
|
|
309
|
+
* reach: ['did:ex:alice', 'did:ex:bob', 'did:ex:charlie'],
|
|
310
|
+
* expiresIn: 86400, // 24 hours
|
|
311
|
+
* policyHash: 'sha-256:abc123...',
|
|
312
|
+
* adminDids: ['did:ex:admin1'], // Optional admin co-signature
|
|
313
|
+
* })
|
|
314
|
+
*
|
|
315
|
+
* // Include in route-advertise message
|
|
316
|
+
* await agent.dids.sendMessage({
|
|
317
|
+
* to: hostDid,
|
|
318
|
+
* body: {
|
|
319
|
+
* type: 'https://didcomm.org/group-messaging/1.0/route-advertise',
|
|
320
|
+
* room_did: 'did:peer:room123',
|
|
321
|
+
* reach: ['did:ex:alice', 'did:ex:bob'],
|
|
322
|
+
* attestation
|
|
323
|
+
* }
|
|
324
|
+
* })
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
createRouterAttestation(options: CreateRouterAttestationOptions): Promise<RouterAttestation>;
|
|
328
|
+
/**
|
|
329
|
+
* Verify a router attestation
|
|
330
|
+
*
|
|
331
|
+
* Verifies that a router attestation has:
|
|
332
|
+
* - Valid signature from router DID
|
|
333
|
+
* - Correct room DID
|
|
334
|
+
* - Not expired
|
|
335
|
+
* - Optional admin co-signature validation
|
|
336
|
+
*
|
|
337
|
+
* @param attestation - Router attestation to verify
|
|
338
|
+
* @param options - Verification options
|
|
339
|
+
* @returns Verification result with validity and details
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* ```typescript
|
|
343
|
+
* // Host receives route-advertise message
|
|
344
|
+
* const { attestation } = message.body
|
|
345
|
+
*
|
|
346
|
+
* // Verify attestation
|
|
347
|
+
* const result = await agent.modules.signing.verifyRouterAttestation(attestation, {
|
|
348
|
+
* roomDid: 'did:peer:room123',
|
|
349
|
+
* expectedRouter: 'did:ex:router1',
|
|
350
|
+
* enforceExpiry: true,
|
|
351
|
+
* allowedRouters: ['did:ex:router1', 'did:ex:router2'],
|
|
352
|
+
* authorizedAdmins: ['did:ex:admin1'],
|
|
353
|
+
* requireAdminSignature: false,
|
|
354
|
+
* })
|
|
355
|
+
*
|
|
356
|
+
* if (result.valid) {
|
|
357
|
+
* // Register router for this room
|
|
358
|
+
* await routerRegistry.register(result.routerDid, result.reach)
|
|
359
|
+
* } else {
|
|
360
|
+
* console.error('Invalid router attestation:', result.reason)
|
|
361
|
+
* }
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
verifyRouterAttestation(attestation: RouterAttestation, options: VerifyRouterAttestationOptions): Promise<RouterAttestationVerificationResult>;
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
export { SigningApi };
|
|
368
|
+
//# sourceMappingURL=SigningApi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SigningApi.d.mts","names":[],"sources":["../src/SigningApi.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;cA8Ca,UAAA;EAAA,QACH,cAAA;EAAA,QACA,aAAA;EAAA,QACA,iBAAA;EAAA,QACA,YAAA;cAGN,sBAAA,EAAwB,6BAAA,EACxB,cAAA,EAAgB,cAAA,EAChB,aAAA,EAAe,oBAAA,EACf,iBAAA,EAAmB,wBAAA,EACnB,YAAA,EAAc,YAAA;EADK;;;EAAA,QAcb,uBAAA;EA2BL;;;;;;;;;;EALU,mBAAA,CACX,YAAA,UACA,OAAA;IACE,OAAA,GAAU,OAAA;EAAA,IAEX,OAAA,CAAQ,oBAAA;EA4NA;;;;;;;;;;EA9LE,cAAA,CACX,YAAA,UACA,MAAA;IACE,MAAA,EAAQ,cAAA;IACR,KAAA,EAAO,WAAA;IACP,OAAA,GAAU,OAAA;IACV,SAAA;IACA,OAAA;IACA,cAAA;IACA,EAAA;MACE,kBAAA;IAAA;EAAA,IAGH,OAAA,CAAQ,oBAAA;EAwVG;;;;;;;;;EAvSD,aAAA,CACX,SAAA,UACA,MAAA;IACE,QAAA;IACA,KAAA;EAAA,IAED,OAAA,CAAQ,oBAAA;EAoeI;;;;;;;;;EApcF,IAAA,CACX,SAAA,UACA,MAAA;IACE,QAAA;IACA,KAAA;EAAA,IAED,OAAA,CAAQ,oBAAA;EAnLO;;;;;;;;;;EAoNL,qBAAA,CACX,SAAA,UACA,MAAA;IACE,YAAA,GAAe,UAAA;IACf,gBAAA;EAAA,IAED,OAAA,CAAQ,oBAAA;EA/KR;;;;;;;;;EAyNU,OAAA,CACX,SAAA,UACA,MAAA,WACC,OAAA,CAAQ,oBAAA;EAxLP;;;;;;;;;EAyNS,OAAA,CACX,SAAA,UACA,MAAA;IACE,IAAA;IACA,OAAA;EAAA,IAED,OAAA,CAAQ,oBAAA;EAjKR;;;;;;EAgMU,OAAA,CAAQ,SAAA,WAAoB,OAAA,CAAQ,oBAAA;EA1J9C;;;;;EAmKU,MAAA,CAAA,GAAU,OAAA,CAAQ,oBAAA;EA9H3B;;;;;;;EAyIS,cAAA,CACX,KAAA,EAAO,KAAA,CAAM,oBAAA,GACb,YAAA,GAAe,YAAA,GACd,OAAA,CAAQ,oBAAA;EA7FA;;;;;;;;;;;;;;;;;;;;;EA0HE,mBAAA,CAAoB,OAAA,EAAS,0BAAA,GAA6B,OAAA,CAAQ,YAAA;EA7BpE;;;;;;;;;;;;;;;;;;;;EAqDE,mBAAA,CACX,KAAA,EAAO,YAAA,EACP,OAAA,EAAS,0BAAA,GACR,OAAA,CAAQ,uBAAA;EAkBG;;;;;;;;EAND,aAAA,CAAc,OAAA;IACzB,MAAA;IACA,OAAA;IACA,MAAA;IACA,QAAA;IACA,OAAA,GAAU,MAAA;IACV,SAAA,GAAY,IAAA;EAAA,IACV,OAAA;IAAU,QAAA,EAAU,YAAA;EAAA;EAwJb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA9FE,eAAA,CAAgB,OAAA,EAAS,sBAAA,GAAyB,OAAA,CAAQ,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2C1D,eAAA,CACX,SAAA,EAAW,SAAA,EACX,OAAA,EAAS,sBAAA,GACR,OAAA,CAAQ,2BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CE,uBAAA,CACX,OAAA,EAAS,8BAAA,GACR,OAAA,CAAQ,iBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCE,uBAAA,CACX,WAAA,EAAa,iBAAA,EACb,OAAA,EAAS,8BAAA,GACR,OAAA,CAAQ,mCAAA;AAAA"}
|