@sphereon/ssi-sdk-ext.jwt-service 0.24.1-unstable.85
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 +201 -0
- package/README.md +433 -0
- package/dist/agent/JwtService.d.ts +14 -0
- package/dist/agent/JwtService.d.ts.map +1 -0
- package/dist/agent/JwtService.js +50 -0
- package/dist/agent/JwtService.js.map +1 -0
- package/dist/functions/index.d.ts +21 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +235 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/types/IJwtService.d.ts +94 -0
- package/dist/types/IJwtService.d.ts.map +1 -0
- package/dist/types/IJwtService.js +4 -0
- package/dist/types/IJwtService.js.map +1 -0
- package/package.json +70 -0
- package/plugin.schema.json +1427 -0
- package/src/agent/JwtService.ts +50 -0
- package/src/functions/index.ts +286 -0
- package/src/index.ts +11 -0
- package/src/types/IJwtService.ts +118 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
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 [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
<!--suppress HtmlDeprecatedAttribute -->
|
|
2
|
+
<h1 align="center">
|
|
3
|
+
<br>
|
|
4
|
+
<a href="https://www.sphereon.com"><img src="https://sphereon.com/content/themes/sphereon/assets/img/logo.svg" alt="Sphereon" width="400"></a>
|
|
5
|
+
<br>Jwt and JWS signature service
|
|
6
|
+
<br>
|
|
7
|
+
</h1>
|
|
8
|
+
|
|
9
|
+
A plugin that in a uniform way can resolve any supported external identifiers, as well as get managed identifiers. It
|
|
10
|
+
performs validations as well as return the objects in a uniform way. Public keys will always be resolved and presented
|
|
11
|
+
as JWKs.
|
|
12
|
+
|
|
13
|
+
Currently, it supports the following identifier methods and types:
|
|
14
|
+
|
|
15
|
+
- DIDs (and the internal IIdentifier type)
|
|
16
|
+
- JWKs (JWK object and public key in hex)
|
|
17
|
+
- kid, KMS key references and jwk thumbprints
|
|
18
|
+
- X.509 certificate chains
|
|
19
|
+
|
|
20
|
+
TODO:
|
|
21
|
+
|
|
22
|
+
- https .well-knowns (JWKSet)
|
|
23
|
+
- OIDC Discovery
|
|
24
|
+
- X.509 CN en SANs
|
|
25
|
+
- OID4VCI Issuers
|
|
26
|
+
|
|
27
|
+
Since the plugin dynamically looks for the correct agent plugins based on the types being resolved, this plugin should
|
|
28
|
+
be used for any and all identifier resolution.
|
|
29
|
+
|
|
30
|
+
No matter whether the plugin is doing resolution of external identifiers or managed/internal identifiers, the results
|
|
31
|
+
will always include certain objects, like the JWK key(s) associated, certificates etc. This ensures uniform handling in
|
|
32
|
+
all places that rely on key/identifier management.
|
|
33
|
+
|
|
34
|
+
## Managed Identifiers
|
|
35
|
+
|
|
36
|
+
Managed or internal identifiers, are identifiers that are being controlled by the agent. This means the agent either has
|
|
37
|
+
access to the private key, or is using a hardware protected mechanism with access to the private key. All of the managed
|
|
38
|
+
methods return both a JWK managed by the agent, an IKey instance, which is the internal key representations, as well as
|
|
39
|
+
a kmsKeyRef allowing you to retrieve the key easily later.
|
|
40
|
+
|
|
41
|
+
Read an identifier by IIdentifier object or DID (or did URL)
|
|
42
|
+
|
|
43
|
+
### DIDs and IIdentifiers
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
const identifier = await agent.didManagerCreate({ kms: 'local' })
|
|
47
|
+
// Created an idenftier. For example did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0"
|
|
48
|
+
|
|
49
|
+
let resolution = await agent.identifierManagedGet({ identifier })
|
|
50
|
+
console.log(JSON.stringify(resolution, null, 2))
|
|
51
|
+
|
|
52
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
53
|
+
resolution = await agent.identifierManagedGetByDid({ identifier })
|
|
54
|
+
|
|
55
|
+
resolution = await agent.identifierManagedGet({
|
|
56
|
+
identifier:
|
|
57
|
+
'did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0',
|
|
58
|
+
})
|
|
59
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
60
|
+
resolution = await agent.identifierManagedGetByDid({
|
|
61
|
+
identifier:
|
|
62
|
+
'did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0',
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
result (some parts omited for brevity:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"method": "did",
|
|
71
|
+
"jwk": {
|
|
72
|
+
"alg": "ES256",
|
|
73
|
+
"kty": "EC",
|
|
74
|
+
"crv": "P-256",
|
|
75
|
+
"x": "GjhS83y2FihjbF38P_sMUKf935hVvMDsck0DgxxmC34",
|
|
76
|
+
"y": "SpVOGx5levQc5M_Y3eAM2ouhfFqtUsPzU__DAITX-hI",
|
|
77
|
+
"kid": "77_7PdYbkikec5AR6zSKVIxgNExChvuOLLULBwS6jwc"
|
|
78
|
+
},
|
|
79
|
+
"jwkThumbprint": "77_7PdYbkikec5AR6zSKVIxgNExChvuOLLULBwS6jwc",
|
|
80
|
+
"identifier": {
|
|
81
|
+
"did": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0",
|
|
82
|
+
"controllerKeyId": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0#0",
|
|
83
|
+
"keys": [
|
|
84
|
+
{
|
|
85
|
+
<snip>
|
|
86
|
+
"kms": "local"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"services": [],
|
|
90
|
+
"provider": "did:jwk"
|
|
91
|
+
},
|
|
92
|
+
"did": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0",
|
|
93
|
+
"controllerKeyId": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0#0",
|
|
94
|
+
"keys": [
|
|
95
|
+
{
|
|
96
|
+
<snip,
|
|
97
|
+
see
|
|
98
|
+
key
|
|
99
|
+
below>
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"key": {
|
|
103
|
+
"type": "Secp256r1",
|
|
104
|
+
"kid": "021a3852f37cb61628636c5dfc3ffb0c50a7fddf9855bcc0ec724d03831c660b7e",
|
|
105
|
+
"publicKeyHex": "021a3852f37cb61628636c5dfc3ffb0c50a7fddf9855bcc0ec724d03831c660b7e",
|
|
106
|
+
"kms": "local",
|
|
107
|
+
"meta": <snip>
|
|
108
|
+
},
|
|
109
|
+
"kmsKeyRef": "021a3852f37cb61628636c5dfc3ffb0c50a7fddf9855bcc0ec724d03831c660b7e"
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### KMS Key reference, JWK Thumbprint
|
|
114
|
+
|
|
115
|
+
Read a managed identifier by kmsRef, or jwkThumbprint, using the above example. The response is the same, minus the
|
|
116
|
+
identifier object, did and controllerKey values in the result as it will be a single key only in this case.
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
// JWK Thumbprint
|
|
120
|
+
resolution = await agent.identifierManagedGet({ identifier: '77_7PdYbkikec5AR6zSKVIxgNExChvuOLLULBwS6jwc' })
|
|
121
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
122
|
+
resolution = await agent.identifierManagedGetByKid({ identifier: '77_7PdYbkikec5AR6zSKVIxgNExChvuOLLULBwS6jwc' })
|
|
123
|
+
|
|
124
|
+
// KMS Key ref
|
|
125
|
+
resolution = await agent.identifierManagedGet({ identifier: '021a3852f37cb61628636c5dfc3ffb0c50a7fddf9855bcc0ec724d03831c660b7e' })
|
|
126
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
127
|
+
resolution = await agent.identifierManagedGetByKid({ identifier: '021a3852f37cb61628636c5dfc3ffb0c50a7fddf9855bcc0ec724d03831c660b7e' })
|
|
128
|
+
|
|
129
|
+
const jwk = {
|
|
130
|
+
alg: 'ES256',
|
|
131
|
+
kty: 'EC',
|
|
132
|
+
crv: 'P-256',
|
|
133
|
+
x: 'GjhS83y2FihjbF38P_sMUKf935hVvMDsck0DgxxmC34',
|
|
134
|
+
y: 'SpVOGx5levQc5M_Y3eAM2ouhfFqtUsPzU__DAITX-hI',
|
|
135
|
+
kid: '77_7PdYbkikec5AR6zSKVIxgNExChvuOLLULBwS6jwc',
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// By JWK object
|
|
139
|
+
resolution = await agent.identifierManagedGet({ identifier: jwk })
|
|
140
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
141
|
+
resolution = await agent.identifierManagedGetByJwk({ identifier: jwk })
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## External Identifiers
|
|
145
|
+
|
|
146
|
+
We will use the example JWK above again, as that is an in memory construct, we can also resolve it like an external
|
|
147
|
+
identifier
|
|
148
|
+
|
|
149
|
+
### DIDs
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
const did =
|
|
153
|
+
'did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiR2poUzgzeTJGaWhqYkYzOFBfc01VS2Y5MzVoVnZNRHNjazBEZ3h4bUMzNCIsInkiOiJTcFZPR3g1bGV2UWM1TV9ZM2VBTTJvdWhmRnF0VXNQelVfX0RBSVRYLWhJIn0'
|
|
154
|
+
|
|
155
|
+
resolution = await agent.identifierExternalResolve({ identifier: did })
|
|
156
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
157
|
+
resolution = await agent.identifierExternalResolveByDid({ identifier: did })
|
|
158
|
+
console.log(JSON.stringify(resolution, null, 2))
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Results in the following JSON, with some properties removed for brevity
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"method": "did",
|
|
166
|
+
"did": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
167
|
+
"jwks": [
|
|
168
|
+
{
|
|
169
|
+
"jwk": {
|
|
170
|
+
"alg": "ES256",
|
|
171
|
+
"use": "sig",
|
|
172
|
+
"kty": "EC",
|
|
173
|
+
"crv": "P-256",
|
|
174
|
+
"x": "wdIEmfjmaZiGsub9Hffnhbr0xVVVmVLiUYLscgRt-3Y",
|
|
175
|
+
"y": "ept3ke4SslZb7ZbweWKmSaM3166ZuvecZ9ciKs6PDcw",
|
|
176
|
+
"kid": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
177
|
+
},
|
|
178
|
+
"jwkThumbprint": "gBT5We3eKcs3NNBAeJ40iPHbWvqAmY8C8L36rGwOAJk",
|
|
179
|
+
"kid": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"didJwks": {
|
|
183
|
+
// These are the JWKs per verification method relationship. For a JWK this includes the above JWK, so we will not repeat it here
|
|
184
|
+
"verificationMethod": [
|
|
185
|
+
{
|
|
186
|
+
<snip>
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"assertionMethod": [
|
|
190
|
+
{
|
|
191
|
+
<snip>
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"authentication": [
|
|
195
|
+
{
|
|
196
|
+
<snip>
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
"keyAgreement": [],
|
|
200
|
+
"capabilityInvocation": [
|
|
201
|
+
{
|
|
202
|
+
<snip>
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"capabilityDelegation": [
|
|
206
|
+
{
|
|
207
|
+
<snip>
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"didDocument": {
|
|
212
|
+
"@context": [
|
|
213
|
+
"https://www.w3.org/ns/did/v1",
|
|
214
|
+
{
|
|
215
|
+
"@vocab": "https://www.iana.org/assignments/jose#"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"id": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
219
|
+
"verificationMethod": [
|
|
220
|
+
{
|
|
221
|
+
"id": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0",
|
|
222
|
+
"type": "JsonWebKey2020",
|
|
223
|
+
"controller": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
224
|
+
"publicKeyJwk": {
|
|
225
|
+
"alg": "ES256",
|
|
226
|
+
"use": "sig",
|
|
227
|
+
"kty": "EC",
|
|
228
|
+
"crv": "P-256",
|
|
229
|
+
"x": "wdIEmfjmaZiGsub9Hffnhbr0xVVVmVLiUYLscgRt-3Y",
|
|
230
|
+
"y": "ept3ke4SslZb7ZbweWKmSaM3166ZuvecZ9ciKs6PDcw",
|
|
231
|
+
"kid": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"assertionMethod": [
|
|
236
|
+
"did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
237
|
+
],
|
|
238
|
+
"authentication": [
|
|
239
|
+
"did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
240
|
+
],
|
|
241
|
+
"capabilityInvocation": [
|
|
242
|
+
"did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
243
|
+
],
|
|
244
|
+
"capabilityDelegation": [
|
|
245
|
+
"did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0#0"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"didResolutionResult": {
|
|
249
|
+
"didDocumentMetadata": {},
|
|
250
|
+
"didResolutionMetadata": {
|
|
251
|
+
"contentType": "application/did+ld+json",
|
|
252
|
+
"pattern": "^(did:jwk:.+)$",
|
|
253
|
+
"did": {
|
|
254
|
+
"didString": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
255
|
+
"methodSpecificId": "eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
256
|
+
"method": "jwk"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"didParsed": {
|
|
261
|
+
"did": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
262
|
+
"method": "jwk",
|
|
263
|
+
"id": "eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0",
|
|
264
|
+
"didUrl": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4Ijoid2RJRW1mam1hWmlHc3ViOUhmZm5oYnIweFZWVm1WTGlVWUxzY2dSdC0zWSIsInkiOiJlcHQza2U0U3NsWmI3WmJ3ZVdLbVNhTTMxNjZadXZlY1o5Y2lLczZQRGN3In0"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### X.509 Certificate Chains
|
|
270
|
+
|
|
271
|
+
You can provide an optional verification time as well using a Date as value. By default the X5C will be fully verified,
|
|
272
|
+
unless the verification param is set to false.
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
const sphereonCA = 'PEM or DER CERT'
|
|
276
|
+
const sphereonTest = 'PEM or DER CERT'
|
|
277
|
+
|
|
278
|
+
let resolution = await agent.identifierExternalResolve({
|
|
279
|
+
identifier: [sphereonTest, sphereonCA],
|
|
280
|
+
trustAnchors: [sphereonCA],
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
// This is the same as above, but with the benefit of having fully typed response, instead of a union
|
|
284
|
+
resolution = await agent.identifierExternalResolveByX5c({
|
|
285
|
+
identifier: [sphereonTest, sphereonCA],
|
|
286
|
+
trustAnchors: [sphereonCA],
|
|
287
|
+
})
|
|
288
|
+
|
|
289
|
+
console.log(JSON.stringify(resolution, null, 2))
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"method": "x5c",
|
|
295
|
+
"verificationResult": {
|
|
296
|
+
"error": false,
|
|
297
|
+
"critical": false,
|
|
298
|
+
"message": "Certificate chain was valid",
|
|
299
|
+
"verificationTime": "2024-08-13T13:28:16.457Z",
|
|
300
|
+
"certificateChain": [
|
|
301
|
+
{
|
|
302
|
+
"issuer": {
|
|
303
|
+
"dn": {
|
|
304
|
+
"DN": "C=NL,O=Sphereon International B.V.,OU=IT,CN=ca.sphereon.com",
|
|
305
|
+
"attributes": {
|
|
306
|
+
"C": "NL",
|
|
307
|
+
"O": "Sphereon International B.V.",
|
|
308
|
+
"OU": "IT",
|
|
309
|
+
"CN": "ca.sphereon.com"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"subject": {
|
|
314
|
+
"dn": {
|
|
315
|
+
"DN": "CN=test123.test.sphereon.com",
|
|
316
|
+
"attributes": {
|
|
317
|
+
"CN": "test123.test.sphereon.com"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"publicKeyJWK": {
|
|
322
|
+
"key_ops": ["verify"],
|
|
323
|
+
"ext": true,
|
|
324
|
+
"kty": "EC",
|
|
325
|
+
"x": "pyVHVR7IdgWmG_TLb3-K_4dg3XC6GQQWDB61Lna15ns",
|
|
326
|
+
"y": "OcVNCBD0kMmqEaKjbczwd2GvbV1AOxgE7AKsa3L0zxM",
|
|
327
|
+
"crv": "P-256"
|
|
328
|
+
},
|
|
329
|
+
"notBefore": "2024-08-06T20:16:12.000Z",
|
|
330
|
+
"notAfter": "2024-11-04T22:16:12.000Z"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"issuer": {
|
|
334
|
+
"dn": {
|
|
335
|
+
"DN": "C=NL,O=Sphereon International B.V.,OU=IT,CN=ca.sphereon.com",
|
|
336
|
+
"attributes": {
|
|
337
|
+
"C": "NL",
|
|
338
|
+
"O": "Sphereon International B.V.",
|
|
339
|
+
"OU": "IT",
|
|
340
|
+
"CN": "ca.sphereon.com"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"subject": {
|
|
345
|
+
"dn": {
|
|
346
|
+
"DN": "C=NL,O=Sphereon International B.V.,OU=IT,CN=ca.sphereon.com",
|
|
347
|
+
"attributes": {
|
|
348
|
+
"C": "NL",
|
|
349
|
+
"O": "Sphereon International B.V.",
|
|
350
|
+
"OU": "IT",
|
|
351
|
+
"CN": "ca.sphereon.com"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"publicKeyJWK": {
|
|
356
|
+
"key_ops": ["verify"],
|
|
357
|
+
"ext": true,
|
|
358
|
+
"kty": "EC",
|
|
359
|
+
"x": "SIDQp4RJI2s5yYIOBrxiwGRROCjBkbCq8vaf3UlSkAw",
|
|
360
|
+
"y": "dRSwvlVFdqdiLXnk2pQqT1vZnDG0I-x-iz2EbdsG0aY",
|
|
361
|
+
"crv": "P-256"
|
|
362
|
+
},
|
|
363
|
+
"notBefore": "2024-07-28T21:26:49.000Z",
|
|
364
|
+
"notAfter": "2034-07-28T21:26:49.000Z"
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
"issuerJWK": {
|
|
369
|
+
"key_ops": ["verify"],
|
|
370
|
+
"ext": true,
|
|
371
|
+
"kty": "EC",
|
|
372
|
+
"x": "pyVHVR7IdgWmG_TLb3-K_4dg3XC6GQQWDB61Lna15ns",
|
|
373
|
+
"y": "OcVNCBD0kMmqEaKjbczwd2GvbV1AOxgE7AKsa3L0zxM",
|
|
374
|
+
"crv": "P-256"
|
|
375
|
+
},
|
|
376
|
+
"jwks": [
|
|
377
|
+
{
|
|
378
|
+
"jwk": {
|
|
379
|
+
"key_ops": ["verify"],
|
|
380
|
+
"ext": true,
|
|
381
|
+
"kty": "EC",
|
|
382
|
+
"x": "pyVHVR7IdgWmG_TLb3-K_4dg3XC6GQQWDB61Lna15ns",
|
|
383
|
+
"y": "OcVNCBD0kMmqEaKjbczwd2GvbV1AOxgE7AKsa3L0zxM",
|
|
384
|
+
"crv": "P-256"
|
|
385
|
+
},
|
|
386
|
+
"kid": "CN=test123.test.sphereon.com",
|
|
387
|
+
"jwkThumbprint": "LlITYB6tlvSVtVrMtIEzrkkSQkMSoPslhQ3Rnk1x484"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"jwk": {
|
|
391
|
+
"key_ops": ["verify"],
|
|
392
|
+
"ext": true,
|
|
393
|
+
"kty": "EC",
|
|
394
|
+
"x": "SIDQp4RJI2s5yYIOBrxiwGRROCjBkbCq8vaf3UlSkAw",
|
|
395
|
+
"y": "dRSwvlVFdqdiLXnk2pQqT1vZnDG0I-x-iz2EbdsG0aY",
|
|
396
|
+
"crv": "P-256"
|
|
397
|
+
},
|
|
398
|
+
"kid": "C=NL,O=Sphereon International B.V.,OU=IT,CN=ca.sphereon.com",
|
|
399
|
+
"jwkThumbprint": "1wAefk4zZ8Q8cM-9djHoJhPUtKjVFLqG7u9VftVqulA"
|
|
400
|
+
}
|
|
401
|
+
],
|
|
402
|
+
"x5c": [
|
|
403
|
+
"MIIC1jCCAnygAwIBAgITALtvb+InWBtzJO3mAeQZIUBXbzAKBggqhkjOPQQDAjBaMQswCQYDVQQGEwJOTDEkMCIGA1UECgwbU3BoZXJlb24gSW50ZXJuYXRpb25hbCBCLlYuMQswCQYDVQQLDAJJVDEYMBYGA1UEAwwPY2Euc3BoZXJlb24uY29tMB4XDTI0MDgwNjIwMTYxMloXDTI0MTEwNDIyMTYxMlowJDEiMCAGA1UEAwwZdGVzdDEyMy50ZXN0LnNwaGVyZW9uLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABKclR1UeyHYFphv0y29/iv+HYN1wuhkEFgwetS52teZ7OcVNCBD0kMmqEaKjbczwd2GvbV1AOxgE7AKsa3L0zxOjggFVMIIBUTAdBgNVHQ4EFgQUoWVOwL15ttB1YPUd0HgvYry0Z+UwHwYDVR0jBBgwFoAU5wfKXZVc+cig/s7jZEUegLMsMsEwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vZXUuY2VydC5lemNhLmlvL2NlcnRzL2RhYTFiNGI0LTg1ZmQtNGJhNC1iOTZiLTMzMmFkZDg5OWNlOS5jZXIwEwYDVR0lBAwwCgYIKwYBBQUHAwIwJAYDVR0RBB0wG4IZdGVzdDEyMy50ZXN0LnNwaGVyZW9uLmNvbTAOBgNVHQ8BAf8EBAMCB4AwYQYDVR0fBFowWDBWoFSgUoZQaHR0cDovL2V1LmNybC5lemNhLmlvL2NybC8yY2RmN2M1ZS1iOWNkLTQzMTctYmI1Ni0zODZkMjQ0MzgwZTIvY2FzcGhlcmVvbmNvbS5jcmwwCgYIKoZIzj0EAwIDSAAwRQIgThuggyhKePvRt5YEvfg6MD42N2/63L0ypw0vLZkM+zYCIQD+uInjqsfR6K/D+ebjuOAdhOyeD2nZAW29zN20WIQJsw==",
|
|
404
|
+
"MIICCDCCAa6gAwIBAgITAPMgqwtYzWPBXaobHhxG9iSydTAKBggqhkjOPQQDAjBaMQswCQYDVQQGEwJOTDEkMCIGA1UECgwbU3BoZXJlb24gSW50ZXJuYXRpb25hbCBCLlYuMQswCQYDVQQLDAJJVDEYMBYGA1UEAwwPY2Euc3BoZXJlb24uY29tMB4XDTI0MDcyODIxMjY0OVoXDTM0MDcyODIxMjY0OVowWjELMAkGA1UEBhMCTkwxJDAiBgNVBAoMG1NwaGVyZW9uIEludGVybmF0aW9uYWwgQi5WLjELMAkGA1UECwwCSVQxGDAWBgNVBAMMD2NhLnNwaGVyZW9uLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEiA0KeESSNrOcmCDga8YsBkUTgowZGwqvL2n91JUpAMdRSwvlVFdqdiLXnk2pQqT1vZnDG0I+x+iz2EbdsG0aajUzBRMB0GA1UdDgQWBBTnB8pdlVz5yKD+zuNkRR6AsywywTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMCA0gAMEUCIHH7ie1OAAbff5262rzZVQa8J9zENG8AQlHHFydMdgaXAiEA1Ib82mhHIYDziE0DDbHEAXOs98al+7dpo8fPGVGTeKI="
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Installation
|
|
410
|
+
|
|
411
|
+
```shell
|
|
412
|
+
pnpm add @sphereon/ssi-sdk-ext.identifier-resolution
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Build
|
|
416
|
+
|
|
417
|
+
```shell
|
|
418
|
+
pnpm run build
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Test
|
|
422
|
+
|
|
423
|
+
The test command runs:
|
|
424
|
+
|
|
425
|
+
- `prettier`
|
|
426
|
+
- `jest`
|
|
427
|
+
- `coverage`
|
|
428
|
+
|
|
429
|
+
You can also run only a single section of these tests, using for example `yarn test:unit`.
|
|
430
|
+
|
|
431
|
+
```shell
|
|
432
|
+
pnmp run test
|
|
433
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IAgentPlugin } from '@veramo/core';
|
|
2
|
+
import { IJwtService } from '..';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class JwtService implements IAgentPlugin {
|
|
7
|
+
readonly schema: any;
|
|
8
|
+
readonly methods: IJwtService;
|
|
9
|
+
private jwtPrepareJws;
|
|
10
|
+
private jwtCreateJwsJsonGeneralSignature;
|
|
11
|
+
private jwtCreateJwsJsonFlattenedSignature;
|
|
12
|
+
private jwtCreateJwsCompactSignature;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=JwtService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JwtService.d.ts","sourceRoot":"","sources":["../../src/agent/JwtService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAA;AACzC,OAAO,EAOL,WAAW,EAOZ,MAAM,IAAI,CAAA;AAGX;;GAEG;AACH,qBAAa,UAAW,YAAW,YAAY;IAC7C,QAAQ,CAAC,MAAM,MAAgC;IAC/C,QAAQ,CAAC,OAAO,EAAE,WAAW,CAK5B;YAEa,aAAa;YAIb,gCAAgC;YAIhC,kCAAkC;YAIlC,4BAA4B;CAO3C"}
|