@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-next.3 → 0.34.1-next.323

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/dist/index.d.ts CHANGED
@@ -1,29 +1,399 @@
1
1
  import { TKeyType, IIdentifier, IAgentContext, IDIDManager, IResolver, IPluginMethodMap, IDataStoreORM, IKeyManager, ICredentialIssuer, ICredentialVerifier, TAgent, IAgentPlugin } from '@veramo/core';
2
- import { PresentationSignCallback, OPBuilder, OP, VerifiedAuthorizationRequest, URI, PresentationDefinitionWithLocation, RPRegistrationMetadataPayload, ResponseMode, SupportedVersion, VerifyJwtCallback, DcqlResponseOpts, VPTokenLocation, VerifiablePresentationTypeFormat } from '@sphereon/did-auth-siop';
2
+ import { PresentationSignCallback, OPBuilder, OP, VerifiedAuthorizationRequest, URI, RPRegistrationMetadataPayload, ResponseMode, SupportedVersion, VerifyJwtCallback, DcqlResponseOpts } from '@sphereon/did-auth-siop';
3
3
  import { CheckLinkedDomain, ResolveOpts } from '@sphereon/did-auth-siop-adapter';
4
4
  import { DIDDocument } from '@sphereon/did-uni-client';
5
- import { SelectResults, VerifiablePresentationResult } from '@sphereon/pex';
6
5
  import { ManagedIdentifierOptsOrResult, IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
7
6
  import { JwsPayload, IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
8
7
  import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
9
- import { CredentialRole, FindDigitalCredentialArgs, ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store';
8
+ import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store-types';
10
9
  import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
11
10
  import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
12
- import { HasherSync, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
11
+ import { HasherSync, WrappedVerifiableCredential, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
13
12
  import { VerifyCallback } from '@sphereon/wellknown-dids-client';
14
13
  import { EventEmitter } from 'events';
15
14
  import { Interpreter, State, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
16
15
  import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
17
16
  import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
18
- import { DcqlQuery } from 'dcql';
17
+ import { DcqlQuery, DcqlPresentation, DcqlCredential } from 'dcql';
19
18
  import { ICredentialValidation } from '@sphereon/ssi-sdk.credential-validation';
20
- import { Format } from '@sphereon/pex-models';
21
- import { ProofOptions, LinkHandlerAdapter } from '@sphereon/ssi-sdk.core';
22
19
  import { JwtIssuer, JwtHeader, SigningAlgo } from '@sphereon/oid4vc-common';
20
+ import { Format } from '@sphereon/pex-models';
23
21
  import { _ExtendedIKey } from '@veramo/utils';
24
22
  import { SupportedDidMethodEnum } from '@sphereon/ssi-sdk-ext.did-utils';
23
+ import { LinkHandlerAdapter } from '@sphereon/ssi-sdk.core';
25
24
  import { IMachineStatePersistence, SerializableState } from '@sphereon/ssi-sdk.xstate-machine-persistence';
26
25
 
26
+ var IDidAuthSiopOpAuthenticator$1 = {
27
+ components: {
28
+ schemas: {
29
+ IGetSiopSessionArgs: {
30
+ type: "object",
31
+ properties: {
32
+ sessionId: {
33
+ type: "string"
34
+ },
35
+ additionalProperties: false
36
+ },
37
+ required: [
38
+ "sessionId"
39
+ ],
40
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSessionForSiop } "
41
+ },
42
+ IRegisterSiopSessionArgs: {
43
+ type: "object",
44
+ properties: {
45
+ identifier: {
46
+ type: "object",
47
+ properties: {
48
+ did: {
49
+ type: "string"
50
+ },
51
+ alias: {
52
+ type: "string"
53
+ },
54
+ provider: {
55
+ type: "string"
56
+ },
57
+ controllerKeyId: {
58
+ type: "string"
59
+ },
60
+ keys: {
61
+ type: "array",
62
+ items: {
63
+ type: "object",
64
+ properties: {
65
+ additionalProperties: true
66
+ }
67
+ }
68
+ },
69
+ services: {
70
+ type: "array",
71
+ items: {
72
+ type: "object",
73
+ properties: {
74
+ additionalProperties: true
75
+ }
76
+ }
77
+ }
78
+ },
79
+ additionalProperties: false,
80
+ required: [
81
+ "did",
82
+ "provider",
83
+ "keys",
84
+ "services"
85
+ ]
86
+ },
87
+ sessionId: {
88
+ type: "string"
89
+ },
90
+ expiresIn: {
91
+ type: "number"
92
+ },
93
+ additionalProperties: false
94
+ },
95
+ required: [
96
+ "identifier"
97
+ ],
98
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.registerSessionForSiop } "
99
+ },
100
+ IRemoveSiopSessionArgs: {
101
+ type: "object",
102
+ properties: {
103
+ sessionId: {
104
+ type: "string"
105
+ },
106
+ additionalProperties: false
107
+ },
108
+ required: [
109
+ "sessionId"
110
+ ],
111
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.removeSessionForSiop } "
112
+ },
113
+ IAuthenticateWithSiopArgs: {
114
+ type: "object",
115
+ properties: {
116
+ sessionId: {
117
+ type: "string"
118
+ },
119
+ stateId: {
120
+ type: "string"
121
+ },
122
+ redirectUrl: {
123
+ type: "string"
124
+ },
125
+ additionalProperties: false
126
+ },
127
+ required: [
128
+ "sessionId",
129
+ "stateId",
130
+ "redirectUrl"
131
+ ],
132
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.authenticateWithSiop } "
133
+ },
134
+ IResponse: {
135
+ type: "object",
136
+ properties: {
137
+ status: {
138
+ type: "number"
139
+ },
140
+ additionalProperties: true
141
+ },
142
+ required: [
143
+ "status"
144
+ ],
145
+ description: "Result of {@link DidAuthSiopOpAuthenticator.authenticateWithSiop & DidAuthSiopOpAuthenticator.sendSiopAuthenticationResponse } "
146
+ },
147
+ IGetSiopAuthenticationRequestFromRpArgs: {
148
+ type: "object",
149
+ properties: {
150
+ sessionId: {
151
+ type: "string"
152
+ },
153
+ stateId: {
154
+ type: "string"
155
+ },
156
+ redirectUrl: {
157
+ type: "string"
158
+ },
159
+ additionalProperties: false
160
+ },
161
+ required: [
162
+ "sessionId",
163
+ "stateId",
164
+ "redirectUrl"
165
+ ],
166
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestFromRP } "
167
+ },
168
+ ParsedAuthenticationRequestURI: {
169
+ type: "object",
170
+ properties: {
171
+ jwt: {
172
+ type: "string"
173
+ },
174
+ requestPayload: {
175
+ type: "object",
176
+ properties: {
177
+ additionalProperties: true
178
+ }
179
+ },
180
+ registration: {
181
+ type: "object",
182
+ properties: {
183
+ additionalProperties: true
184
+ }
185
+ },
186
+ additionalProperties: false
187
+ },
188
+ required: [
189
+ "jwt",
190
+ "requestPayload",
191
+ "registration"
192
+ ],
193
+ description: "Result of {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestFromRP } "
194
+ },
195
+ IGetSiopAuthenticationRequestDetailsArgs: {
196
+ type: "object",
197
+ properties: {
198
+ sessionId: {
199
+ type: "string"
200
+ },
201
+ verifiedAuthenticationRequest: {
202
+ type: "object",
203
+ properties: {
204
+ additionalProperties: true
205
+ }
206
+ },
207
+ credentialFilter: {
208
+ type: "object",
209
+ properties: {
210
+ additionalProperties: true
211
+ }
212
+ },
213
+ additionalProperties: false
214
+ },
215
+ required: [
216
+ "sessionId",
217
+ "verifiedAuthenticationRequest"
218
+ ],
219
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestDetails } "
220
+ },
221
+ IAuthRequestDetails: {
222
+ type: "object",
223
+ properties: {
224
+ id: {
225
+ type: "string"
226
+ },
227
+ alsoKnownAs: {
228
+ type: "array",
229
+ items: {
230
+ type: "string"
231
+ }
232
+ },
233
+ vpResponseOpts: {
234
+ type: "object",
235
+ properties: {
236
+ additionalProperties: true
237
+ }
238
+ },
239
+ additionalProperties: false
240
+ },
241
+ required: [
242
+ "id",
243
+ "vpResponseOpts"
244
+ ],
245
+ description: "Result of {@link DidAuthSiopOpAuthenticator.getSiopAuthenticationRequestDetails } "
246
+ },
247
+ IVerifySiopAuthenticationRequestUriArgs: {
248
+ type: "object",
249
+ properties: {
250
+ sessionId: {
251
+ type: "string"
252
+ },
253
+ ParsedAuthenticationRequestURI: {
254
+ type: "object",
255
+ properties: {
256
+ additionalProperties: true
257
+ }
258
+ },
259
+ additionalProperties: false
260
+ },
261
+ required: [
262
+ "sessionId",
263
+ "ParsedAuthenticationRequestURI"
264
+ ],
265
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.verifySiopAuthenticationRequestURI } "
266
+ },
267
+ VerifiedAuthorizationRequest: {
268
+ type: "object",
269
+ properties: {
270
+ payload: {
271
+ type: "object",
272
+ properties: {
273
+ additionalProperties: true
274
+ }
275
+ },
276
+ presentationDefinitions: {
277
+ type: "object",
278
+ properties: {
279
+ additionalProperties: true
280
+ }
281
+ },
282
+ verifyOpts: {
283
+ type: "object",
284
+ properties: {
285
+ additionalProperties: true
286
+ }
287
+ },
288
+ additionalProperties: false
289
+ },
290
+ required: [
291
+ "payload",
292
+ "verifyOpts"
293
+ ],
294
+ description: "Result of {@link DidAuthSiopOpAuthenticator.verifySiopAuthenticationRequestURI } "
295
+ },
296
+ ISendSiopAuthenticationResponseArgs: {
297
+ type: "object",
298
+ properties: {
299
+ sessionId: {
300
+ type: "string"
301
+ },
302
+ verifiedAuthenticationRequest: {
303
+ type: "object",
304
+ properties: {
305
+ additionalProperties: true
306
+ }
307
+ },
308
+ verifiablePresentationResponse: {
309
+ type: "object",
310
+ properties: {
311
+ additionalProperties: true
312
+ }
313
+ },
314
+ additionalProperties: false
315
+ },
316
+ required: [
317
+ "sessionId",
318
+ "verifiedAuthenticationRequest"
319
+ ],
320
+ description: "Arguments needed for {@link DidAuthSiopOpAuthenticator.sendSiopAuthenticationResponse } "
321
+ }
322
+ },
323
+ methods: {
324
+ getSessionForSiop: {
325
+ description: "Get SIOP session",
326
+ "arguments": {
327
+ $ref: "#/components/schemas/IGetSiopSessionArgs"
328
+ },
329
+ returnType: "object"
330
+ },
331
+ registerSessionForSiop: {
332
+ description: "Register SIOP session",
333
+ "arguments": {
334
+ $ref: "#/components/schemas/IRegisterSiopSessionArgs"
335
+ },
336
+ returnType: "object"
337
+ },
338
+ removeSessionForSiop: {
339
+ description: "Remove SIOP session",
340
+ "arguments": {
341
+ $ref: "#/components/schemas/IRemoveSiopSessionArgs"
342
+ },
343
+ returnType: "boolean"
344
+ },
345
+ authenticateWithSiop: {
346
+ description: "Authenticate using DID Auth SIOP",
347
+ "arguments": {
348
+ $ref: "#/components/schemas/IAuthenticateWithSiopArgs"
349
+ },
350
+ returnType: {
351
+ $ref: "#/components/schemas/Response"
352
+ }
353
+ },
354
+ getSiopAuthenticationRequestFromRP: {
355
+ description: "Get authentication request from RP",
356
+ "arguments": {
357
+ $ref: "#/components/schemas/IGetSiopAuthenticationRequestFromRpArgs"
358
+ },
359
+ returnType: {
360
+ $ref: "#/components/schemas/ParsedAuthenticationRequestURI"
361
+ }
362
+ },
363
+ getSiopAuthenticationRequestDetails: {
364
+ description: "Get authentication request details",
365
+ "arguments": {
366
+ $ref: "#/components/schemas/IGetSiopAuthenticationRequestDetailsArgs"
367
+ },
368
+ returnType: {
369
+ $ref: "#/components/schemas/IAuthRequestDetails"
370
+ }
371
+ },
372
+ verifySiopAuthenticationRequestURI: {
373
+ description: "Verify authentication request URI",
374
+ "arguments": {
375
+ $ref: "#/components/schemas/IVerifySiopAuthenticationRequestUriArgs"
376
+ },
377
+ returnType: {
378
+ $ref: "#/components/schemas/VerifiedAuthorizationRequest"
379
+ }
380
+ },
381
+ sendSiopAuthenticationResponse: {
382
+ description: "Send authentication response",
383
+ "arguments": {
384
+ $ref: "#/components/schemas/ISendSiopAuthenticationResponseArgs"
385
+ },
386
+ returnType: {
387
+ $ref: "#/components/schemas/IRequiredContext"
388
+ }
389
+ }
390
+ }
391
+ }
392
+ };
393
+ var plugin_schema = {
394
+ IDidAuthSiopOpAuthenticator: IDidAuthSiopOpAuthenticator$1
395
+ };
396
+
27
397
  declare function createOID4VPPresentationSignCallback({ presentationSignCallback, idOpts, domain, fetchRemoteContexts, challenge, format, context, skipDidResolution, }: {
28
398
  presentationSignCallback?: PresentationSignCallback;
29
399
  idOpts: ManagedIdentifierOptsOrResult;
@@ -54,6 +424,19 @@ declare function createOP({ opOptions, idOpts, context, }: {
54
424
  }): Promise<OP>;
55
425
  declare function getSigningAlgo(type: TKeyType): SigningAlgo;
56
426
 
427
+ interface PresentationBuilderContext {
428
+ nonce: string;
429
+ audience: string;
430
+ agent: RequiredContext['agent'];
431
+ clockSkew?: number;
432
+ hasher?: HasherSync;
433
+ }
434
+ /**
435
+ * Creates a Verifiable Presentation for a given credential in the appropriate format
436
+ * Ensures nonce/aud (or challenge/domain) are set according to OID4VP draft 28
437
+ */
438
+ declare function createVerifiablePresentationForFormat(credential: UniqueDigitalCredential | WrappedVerifiableCredential | OriginalVerifiableCredential, identifier: ManagedIdentifierOptsOrResult, context: PresentationBuilderContext): Promise<string | object>;
439
+
57
440
  declare class OpSession {
58
441
  readonly ts: number;
59
442
  readonly id: string;
@@ -63,7 +446,6 @@ declare class OpSession {
63
446
  private verifiedAuthorizationRequest?;
64
447
  private _nonce?;
65
448
  private _state?;
66
- private readonly _providedPresentationDefinitions?;
67
449
  private constructor();
68
450
  static init(options: Required<IOpSessionArgs>): Promise<OpSession>;
69
451
  getAuthorizationRequest(): Promise<VerifiedAuthorizationRequest>;
@@ -80,75 +462,8 @@ declare class OpSession {
80
462
  }): Promise<IIdentifier[]>;
81
463
  getSupportedDIDs(): Promise<string[]>;
82
464
  getRedirectUri(): Promise<string>;
83
- hasPresentationDefinitions(): Promise<boolean>;
84
- getPresentationDefinitions(): Promise<Array<PresentationDefinitionWithLocation> | undefined>;
85
- getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP>;
86
- private createPresentationVerificationCallback;
87
465
  private createJarmResponseCallback;
88
466
  sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response>;
89
- private countVCsInAllVPs;
90
- }
91
-
92
- declare class OID4VP {
93
- private readonly session;
94
- private readonly allIdentifiers;
95
- private readonly hasher?;
96
- private constructor();
97
- static init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP>;
98
- getPresentationDefinitions(): Promise<PresentationDefinitionWithLocation[] | undefined>;
99
- private getPresentationExchange;
100
- createVerifiablePresentations(credentialRole: CredentialRole, credentialsWithDefinitions: VerifiableCredentialsWithDefinition[], opts?: {
101
- forceNoCredentialsInVP?: boolean;
102
- restrictToFormats?: Format;
103
- restrictToDIDMethods?: string[];
104
- proofOpts?: ProofOptions;
105
- idOpts?: ManagedIdentifierOptsOrResult;
106
- skipDidResolution?: boolean;
107
- holderDID?: string;
108
- subjectIsHolder?: boolean;
109
- hasher?: HasherSync;
110
- applyFilter?: boolean;
111
- }): Promise<VerifiablePresentationWithDefinition[]>;
112
- createVerifiablePresentation(credentialRole: CredentialRole, selectedVerifiableCredentials: VerifiableCredentialsWithDefinition, opts?: {
113
- forceNoCredentialsInVP?: boolean;
114
- restrictToFormats?: Format;
115
- restrictToDIDMethods?: string[];
116
- proofOpts?: ProofOptions;
117
- idOpts?: ManagedIdentifierOptsOrResult;
118
- skipDidResolution?: boolean;
119
- holder?: string;
120
- subjectIsHolder?: boolean;
121
- applyFilter?: boolean;
122
- hasher?: HasherSync;
123
- }): Promise<VerifiablePresentationWithDefinition>;
124
- filterCredentialsAgainstAllDefinitions(credentialRole: CredentialRole, opts?: {
125
- filterOpts?: {
126
- verifiableCredentials?: UniqueDigitalCredential[];
127
- filter?: FindDigitalCredentialArgs;
128
- };
129
- holderDIDs?: string[];
130
- restrictToFormats?: Format;
131
- restrictToDIDMethods?: string[];
132
- }): Promise<VerifiableCredentialsWithDefinition[]>;
133
- filterCredentials(credentialRole: CredentialRole, presentationDefinition: PresentationDefinitionWithLocation, opts?: {
134
- filterOpts?: {
135
- verifiableCredentials?: (UniqueDigitalCredential | OriginalVerifiableCredential)[];
136
- filter?: FindDigitalCredentialArgs;
137
- };
138
- holderDIDs?: string[];
139
- restrictToFormats?: Format;
140
- restrictToDIDMethods?: string[];
141
- }): Promise<VerifiableCredentialsWithDefinition>;
142
- filterCredentialsWithSelectionStatus(credentialRole: CredentialRole, presentationDefinition: PresentationDefinitionWithLocation, opts?: {
143
- filterOpts?: {
144
- verifiableCredentials?: OriginalVerifiableCredential[];
145
- filter?: FindDigitalCredentialArgs;
146
- };
147
- holderDIDs?: string[];
148
- restrictToFormats?: Format;
149
- restrictToDIDMethods?: string[];
150
- }): Promise<SelectResults>;
151
- private getCredentials;
152
467
  }
153
468
 
154
469
  type ErrorDetails = {
@@ -209,8 +524,7 @@ type Siopv2AuthorizationRequestData = {
209
524
  name?: string;
210
525
  uri?: URL;
211
526
  clientId?: string;
212
- presentationDefinitions?: PresentationDefinitionWithLocation[];
213
- dcqlQuery?: DcqlQuery;
527
+ dcqlQuery: DcqlQuery;
214
528
  };
215
529
  type SelectableCredentialsMap = Map<string, Array<SelectableCredential>>;
216
530
  type SelectableCredential = {
@@ -226,7 +540,7 @@ type OnContactIdentityCreatedArgs = {
226
540
  type OnIdentifierCreatedArgs = {
227
541
  identifier: IIdentifier;
228
542
  };
229
- type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding>;
543
+ type RequiredContext = IAgentContext<IContactManager & IDidAuthSiopOpAuthenticator & IDIDManager & IResolver & IIdentifierResolution & ICredentialStore & IIssuanceBranding & ISDJwtPlugin>;
230
544
 
231
545
  type Siopv2MachineContext = {
232
546
  url: string;
@@ -363,7 +677,7 @@ interface IDidAuthSiopOpAuthenticator extends IPluginMethodMap {
363
677
  interface IOpSessionArgs {
364
678
  sessionId?: string;
365
679
  requestJwtOrUri: string | URI;
366
- providedPresentationDefinitions?: Array<PresentationDefinitionWithLocation>;
680
+ dcqlQuery?: DcqlQuery;
367
681
  identifierOptions?: ManagedIdentifierOptsOrResult;
368
682
  context: IRequiredContext;
369
683
  op?: IOPOptions;
@@ -371,15 +685,9 @@ interface IOpSessionArgs {
371
685
  interface IAuthRequestDetails {
372
686
  rpDIDDocument?: DIDDocument;
373
687
  id: string;
374
- verifiablePresentationMatches: IPresentationWithDefinition[];
688
+ verifiablePresentationMatches: DcqlPresentation[];
375
689
  alsoKnownAs?: string[];
376
690
  }
377
- interface IPresentationWithDefinition {
378
- location: VPTokenLocation;
379
- definition: PresentationDefinitionWithLocation;
380
- format: VerifiablePresentationTypeFormat;
381
- presentation: W3CVerifiablePresentation;
382
- }
383
691
  interface IGetSiopSessionArgs {
384
692
  sessionId: string;
385
693
  }
@@ -401,9 +709,6 @@ interface IOpsSendSiopAuthorizationResponseArgs {
401
709
  hasher?: HasherSync;
402
710
  isFirstParty?: boolean;
403
711
  }
404
- declare enum events {
405
- DID_SIOP_AUTHENTICATED = "didSiopAuthenticated"
406
- }
407
712
  type IRequiredContext = IAgentContext<IDataStoreORM & IResolver & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialValidation & ICredentialVerifier & ICredentialStore & IPDManager & ISDJwtPlugin & IJwtService>;
408
713
  interface IOPOptions {
409
714
  responseMode?: ResponseMode;
@@ -419,15 +724,6 @@ interface IOPOptions {
419
724
  resolveOpts?: ResolveOpts;
420
725
  hasher?: HasherSync;
421
726
  }
422
- interface VerifiableCredentialsWithDefinition {
423
- definition: PresentationDefinitionWithLocation;
424
- credentials: (UniqueDigitalCredential | OriginalVerifiableCredential)[];
425
- }
426
- interface VerifiablePresentationWithDefinition extends VerifiablePresentationResult {
427
- definition: PresentationDefinitionWithLocation;
428
- verifiableCredentials: OriginalVerifiableCredential[];
429
- idOpts: ManagedIdentifierOptsOrResult;
430
- }
431
727
  interface IOpSessionGetOID4VPArgs {
432
728
  allIdentifiers?: string[];
433
729
  hasher?: HasherSync;
@@ -437,14 +733,6 @@ interface IOID4VPArgs {
437
733
  allIdentifiers?: string[];
438
734
  hasher?: HasherSync;
439
735
  }
440
- interface IGetPresentationExchangeArgs {
441
- verifiableCredentials: OriginalVerifiableCredential[];
442
- allIdentifiers?: string[];
443
- hasher?: HasherSync;
444
- }
445
- type Json = string | number | boolean | null | {
446
- [key: string]: Json;
447
- } | Json[];
448
736
  declare const DEFAULT_JWT_PROOF_TYPE = "JwtProof2020";
449
737
 
450
738
  declare const DID_PREFIX = "did";
@@ -491,11 +779,336 @@ type CreateIdentifierOpts = {
491
779
  createOpts?: CreateIdentifierCreateOpts;
492
780
  };
493
781
  type DidAgents = TAgent<IResolver & IDIDManager>;
494
- type SuitableCredentialAgents = TAgent<IContactManager & ICredentialStore & IIssuanceBranding>;
495
782
 
496
783
  declare const didAuthSiopOpAuthenticatorMethods: Array<string>;
497
784
  declare class DidAuthSiopOpAuthenticator implements IAgentPlugin {
498
- readonly schema: any;
785
+ readonly schema: {
786
+ components: {
787
+ schemas: {
788
+ IGetSiopSessionArgs: {
789
+ type: string;
790
+ properties: {
791
+ sessionId: {
792
+ type: string;
793
+ };
794
+ additionalProperties: boolean;
795
+ };
796
+ required: string[];
797
+ description: string;
798
+ };
799
+ IRegisterSiopSessionArgs: {
800
+ type: string;
801
+ properties: {
802
+ identifier: {
803
+ type: string;
804
+ properties: {
805
+ did: {
806
+ type: string;
807
+ };
808
+ alias: {
809
+ type: string;
810
+ };
811
+ provider: {
812
+ type: string;
813
+ };
814
+ controllerKeyId: {
815
+ type: string;
816
+ };
817
+ keys: {
818
+ type: string;
819
+ items: {
820
+ type: string;
821
+ properties: {
822
+ additionalProperties: boolean;
823
+ };
824
+ };
825
+ };
826
+ services: {
827
+ type: string;
828
+ items: {
829
+ type: string;
830
+ properties: {
831
+ additionalProperties: boolean;
832
+ };
833
+ };
834
+ };
835
+ };
836
+ additionalProperties: boolean;
837
+ required: string[];
838
+ };
839
+ sessionId: {
840
+ type: string;
841
+ };
842
+ expiresIn: {
843
+ type: string;
844
+ };
845
+ additionalProperties: boolean;
846
+ };
847
+ required: string[];
848
+ description: string;
849
+ };
850
+ IRemoveSiopSessionArgs: {
851
+ type: string;
852
+ properties: {
853
+ sessionId: {
854
+ type: string;
855
+ };
856
+ additionalProperties: boolean;
857
+ };
858
+ required: string[];
859
+ description: string;
860
+ };
861
+ IAuthenticateWithSiopArgs: {
862
+ type: string;
863
+ properties: {
864
+ sessionId: {
865
+ type: string;
866
+ };
867
+ stateId: {
868
+ type: string;
869
+ };
870
+ redirectUrl: {
871
+ type: string;
872
+ };
873
+ additionalProperties: boolean;
874
+ };
875
+ required: string[];
876
+ description: string;
877
+ };
878
+ IResponse: {
879
+ type: string;
880
+ properties: {
881
+ status: {
882
+ type: string;
883
+ };
884
+ additionalProperties: boolean;
885
+ };
886
+ required: string[];
887
+ description: string;
888
+ };
889
+ IGetSiopAuthenticationRequestFromRpArgs: {
890
+ type: string;
891
+ properties: {
892
+ sessionId: {
893
+ type: string;
894
+ };
895
+ stateId: {
896
+ type: string;
897
+ };
898
+ redirectUrl: {
899
+ type: string;
900
+ };
901
+ additionalProperties: boolean;
902
+ };
903
+ required: string[];
904
+ description: string;
905
+ };
906
+ ParsedAuthenticationRequestURI: {
907
+ type: string;
908
+ properties: {
909
+ jwt: {
910
+ type: string;
911
+ };
912
+ requestPayload: {
913
+ type: string;
914
+ properties: {
915
+ additionalProperties: boolean;
916
+ };
917
+ };
918
+ registration: {
919
+ type: string;
920
+ properties: {
921
+ additionalProperties: boolean;
922
+ };
923
+ };
924
+ additionalProperties: boolean;
925
+ };
926
+ required: string[];
927
+ description: string;
928
+ };
929
+ IGetSiopAuthenticationRequestDetailsArgs: {
930
+ type: string;
931
+ properties: {
932
+ sessionId: {
933
+ type: string;
934
+ };
935
+ verifiedAuthenticationRequest: {
936
+ type: string;
937
+ properties: {
938
+ additionalProperties: boolean;
939
+ };
940
+ };
941
+ credentialFilter: {
942
+ type: string;
943
+ properties: {
944
+ additionalProperties: boolean;
945
+ };
946
+ };
947
+ additionalProperties: boolean;
948
+ };
949
+ required: string[];
950
+ description: string;
951
+ };
952
+ IAuthRequestDetails: {
953
+ type: string;
954
+ properties: {
955
+ id: {
956
+ type: string;
957
+ };
958
+ alsoKnownAs: {
959
+ type: string;
960
+ items: {
961
+ type: string;
962
+ };
963
+ };
964
+ vpResponseOpts: {
965
+ type: string;
966
+ properties: {
967
+ additionalProperties: boolean;
968
+ };
969
+ };
970
+ additionalProperties: boolean;
971
+ };
972
+ required: string[];
973
+ description: string;
974
+ };
975
+ IVerifySiopAuthenticationRequestUriArgs: {
976
+ type: string;
977
+ properties: {
978
+ sessionId: {
979
+ type: string;
980
+ };
981
+ ParsedAuthenticationRequestURI: {
982
+ type: string;
983
+ properties: {
984
+ additionalProperties: boolean;
985
+ };
986
+ };
987
+ additionalProperties: boolean;
988
+ };
989
+ required: string[];
990
+ description: string;
991
+ };
992
+ VerifiedAuthorizationRequest: {
993
+ type: string;
994
+ properties: {
995
+ payload: {
996
+ type: string;
997
+ properties: {
998
+ additionalProperties: boolean;
999
+ };
1000
+ };
1001
+ presentationDefinitions: {
1002
+ type: string;
1003
+ properties: {
1004
+ additionalProperties: boolean;
1005
+ };
1006
+ };
1007
+ verifyOpts: {
1008
+ type: string;
1009
+ properties: {
1010
+ additionalProperties: boolean;
1011
+ };
1012
+ };
1013
+ additionalProperties: boolean;
1014
+ };
1015
+ required: string[];
1016
+ description: string;
1017
+ };
1018
+ ISendSiopAuthenticationResponseArgs: {
1019
+ type: string;
1020
+ properties: {
1021
+ sessionId: {
1022
+ type: string;
1023
+ };
1024
+ verifiedAuthenticationRequest: {
1025
+ type: string;
1026
+ properties: {
1027
+ additionalProperties: boolean;
1028
+ };
1029
+ };
1030
+ verifiablePresentationResponse: {
1031
+ type: string;
1032
+ properties: {
1033
+ additionalProperties: boolean;
1034
+ };
1035
+ };
1036
+ additionalProperties: boolean;
1037
+ };
1038
+ required: string[];
1039
+ description: string;
1040
+ };
1041
+ };
1042
+ methods: {
1043
+ getSessionForSiop: {
1044
+ description: string;
1045
+ arguments: {
1046
+ $ref: string;
1047
+ };
1048
+ returnType: string;
1049
+ };
1050
+ registerSessionForSiop: {
1051
+ description: string;
1052
+ arguments: {
1053
+ $ref: string;
1054
+ };
1055
+ returnType: string;
1056
+ };
1057
+ removeSessionForSiop: {
1058
+ description: string;
1059
+ arguments: {
1060
+ $ref: string;
1061
+ };
1062
+ returnType: string;
1063
+ };
1064
+ authenticateWithSiop: {
1065
+ description: string;
1066
+ arguments: {
1067
+ $ref: string;
1068
+ };
1069
+ returnType: {
1070
+ $ref: string;
1071
+ };
1072
+ };
1073
+ getSiopAuthenticationRequestFromRP: {
1074
+ description: string;
1075
+ arguments: {
1076
+ $ref: string;
1077
+ };
1078
+ returnType: {
1079
+ $ref: string;
1080
+ };
1081
+ };
1082
+ getSiopAuthenticationRequestDetails: {
1083
+ description: string;
1084
+ arguments: {
1085
+ $ref: string;
1086
+ };
1087
+ returnType: {
1088
+ $ref: string;
1089
+ };
1090
+ };
1091
+ verifySiopAuthenticationRequestURI: {
1092
+ description: string;
1093
+ arguments: {
1094
+ $ref: string;
1095
+ };
1096
+ returnType: {
1097
+ $ref: string;
1098
+ };
1099
+ };
1100
+ sendSiopAuthenticationResponse: {
1101
+ description: string;
1102
+ arguments: {
1103
+ $ref: string;
1104
+ };
1105
+ returnType: {
1106
+ $ref: string;
1107
+ };
1108
+ };
1109
+ };
1110
+ };
1111
+ };
499
1112
  readonly methods: IDidAuthSiopOpAuthenticator;
500
1113
  private readonly sessions;
501
1114
  private readonly customApprovals;
@@ -518,11 +1131,6 @@ declare class DidAuthSiopOpAuthenticator implements IAgentPlugin {
518
1131
  private siopRetrieveContact;
519
1132
  private siopAddContactIdentity;
520
1133
  private siopSendResponse;
521
- private hasMDocCredentials;
522
- private isMDocCredential;
523
- private hasSdJwtCredentials;
524
- private isSdJwtCredential;
525
- private retrieveEncodedCredential;
526
1134
  private siopGetSelectableCredentials;
527
1135
  }
528
1136
 
@@ -551,9 +1159,6 @@ declare class Siopv2OID4VPLinkHandler extends LinkHandlerAdapter {
551
1159
  }): Promise<void>;
552
1160
  }
553
1161
 
554
- /**
555
- * @public
556
- */
557
- declare const schema: any;
1162
+ declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
558
1163
 
559
- export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetPresentationExchangeArgs, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IPresentationWithDefinition, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type Json, type KeyOpts, LOGGER_NAMESPACE, type NextEvent, OID4VP, OID4VPCallbackStateListener, type OnContactIdentityCreatedArgs, type OnIdentifierCreatedArgs, OpSession, type PreviousEvent, type RequiredContext, type RetrieveContactArgs, type SelectCredentialsEvent, type SelectableCredential, type SelectableCredentialsMap, type SendResponseArgs, type Siopv2AuthorizationRequestData, type Siopv2AuthorizationResponseData, Siopv2HolderEvent, Siopv2Machine, Siopv2MachineAddContactStates, type Siopv2MachineContext, type Siopv2MachineEventTypes, Siopv2MachineEvents, Siopv2MachineGuards, type Siopv2MachineInstanceOpts, type Siopv2MachineInterpreter, Siopv2MachineServices, type Siopv2MachineState, Siopv2MachineStates, Siopv2OID4VPLinkHandler, type Siopv2StateMachine, type SuitableCredentialAgents, SupportedLanguage, type VerifiableCredentialsWithDefinition, type VerifiablePresentationWithDefinition, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, didAuthSiopOpAuthenticatorMethods, events, getSigningAlgo, schema };
1164
+ export { type AddIdentityArgs, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateConfigResult, type CreateContactEvent, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOrGetIdentifierOpts, type CreateSiopv2MachineOpts, DEFAULT_JWT_PROOF_TYPE, DID_PREFIX, type DeclineEvent, type DidAgents, DidAuthSiopOpAuthenticator, type DidAuthSiopOpAuthenticatorOptions, type ErrorDetails, type GetAuthenticationKeyArgs, type GetIdentifierArgs, type GetMachineArgs, type GetSelectableCredentialsArgs, type GetSiopRequestArgs, type IAuthRequestDetails, type IDidAuthSiopOpAuthenticator, type IGetSiopSessionArgs, type IOID4VPArgs, type IOPOptions, type IOpSessionArgs, type IOpSessionGetOID4VPArgs, type IOpsSendSiopAuthorizationResponseArgs, type IRegisterCustomApprovalForSiopArgs, type IRemoveCustomApprovalForSiopArgs, type IRemoveSiopSessionArgs, type IRequiredContext, type IdentifierProviderOpts, type IdentifierWithKey, type KeyOpts, LOGGER_NAMESPACE, type NextEvent, OID4VPCallbackStateListener, type OnContactIdentityCreatedArgs, type OnIdentifierCreatedArgs, OpSession, type PresentationBuilderContext, type PreviousEvent, type RequiredContext, type RetrieveContactArgs, type SelectCredentialsEvent, type SelectableCredential, type SelectableCredentialsMap, type SendResponseArgs, type Siopv2AuthorizationRequestData, type Siopv2AuthorizationResponseData, Siopv2HolderEvent, Siopv2Machine, Siopv2MachineAddContactStates, type Siopv2MachineContext, type Siopv2MachineEventTypes, Siopv2MachineEvents, Siopv2MachineGuards, type Siopv2MachineInstanceOpts, type Siopv2MachineInterpreter, Siopv2MachineServices, type Siopv2MachineState, Siopv2MachineStates, Siopv2OID4VPLinkHandler, type Siopv2StateMachine, SupportedLanguage, convertToDcqlCredentials, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, createVerifiablePresentationForFormat, didAuthSiopOpAuthenticatorMethods, getSigningAlgo, plugin_schema as schema };