@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-next.299 → 0.34.1-next.322

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.cts CHANGED
@@ -8,7 +8,7 @@ import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.cre
8
8
  import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store-types';
9
9
  import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
10
10
  import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
11
- import { HasherSync, PresentationSubmission, W3CVerifiablePresentation, OriginalVerifiableCredential } from '@sphereon/ssi-types';
11
+ import { HasherSync, WrappedVerifiableCredential, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
12
12
  import { VerifyCallback } from '@sphereon/wellknown-dids-client';
13
13
  import { EventEmitter } from 'events';
14
14
  import { Interpreter, State, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
@@ -424,6 +424,19 @@ declare function createOP({ opOptions, idOpts, context, }: {
424
424
  }): Promise<OP>;
425
425
  declare function getSigningAlgo(type: TKeyType): SigningAlgo;
426
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
+
427
440
  declare class OpSession {
428
441
  readonly ts: number;
429
442
  readonly id: string;
@@ -449,16 +462,10 @@ declare class OpSession {
449
462
  }): Promise<IIdentifier[]>;
450
463
  getSupportedDIDs(): Promise<string[]>;
451
464
  getRedirectUri(): Promise<string>;
452
- getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP>;
453
465
  private createJarmResponseCallback;
454
466
  sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response>;
455
467
  }
456
468
 
457
- declare class OID4VP {
458
- private constructor();
459
- static init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP>;
460
- }
461
-
462
469
  type ErrorDetails = {
463
470
  title: string;
464
471
  message: string;
@@ -1154,4 +1161,4 @@ declare class Siopv2OID4VPLinkHandler extends LinkHandlerAdapter {
1154
1161
 
1155
1162
  declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
1156
1163
 
1157
- 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, 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, SupportedLanguage, convertToDcqlCredentials, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, didAuthSiopOpAuthenticatorMethods, getSigningAlgo, plugin_schema as 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 };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.cre
8
8
  import { ICredentialLocaleBranding, Party, DidAuthConfig, Identity } from '@sphereon/ssi-sdk.data-store-types';
9
9
  import { IPDManager } from '@sphereon/ssi-sdk.pd-manager';
10
10
  import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
11
- import { HasherSync, PresentationSubmission, W3CVerifiablePresentation, OriginalVerifiableCredential } from '@sphereon/ssi-types';
11
+ import { HasherSync, WrappedVerifiableCredential, OriginalVerifiableCredential, PresentationSubmission, W3CVerifiablePresentation } from '@sphereon/ssi-types';
12
12
  import { VerifyCallback } from '@sphereon/wellknown-dids-client';
13
13
  import { EventEmitter } from 'events';
14
14
  import { Interpreter, State, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
@@ -424,6 +424,19 @@ declare function createOP({ opOptions, idOpts, context, }: {
424
424
  }): Promise<OP>;
425
425
  declare function getSigningAlgo(type: TKeyType): SigningAlgo;
426
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
+
427
440
  declare class OpSession {
428
441
  readonly ts: number;
429
442
  readonly id: string;
@@ -449,16 +462,10 @@ declare class OpSession {
449
462
  }): Promise<IIdentifier[]>;
450
463
  getSupportedDIDs(): Promise<string[]>;
451
464
  getRedirectUri(): Promise<string>;
452
- getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP>;
453
465
  private createJarmResponseCallback;
454
466
  sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response>;
455
467
  }
456
468
 
457
- declare class OID4VP {
458
- private constructor();
459
- static init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP>;
460
- }
461
-
462
469
  type ErrorDetails = {
463
470
  title: string;
464
471
  message: string;
@@ -1154,4 +1161,4 @@ declare class Siopv2OID4VPLinkHandler extends LinkHandlerAdapter {
1154
1161
 
1155
1162
  declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
1156
1163
 
1157
- 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, 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, SupportedLanguage, convertToDcqlCredentials, createJwtCallbackWithIdOpts, createJwtCallbackWithOpOpts, createOID4VPPresentationSignCallback, createOP, createOPBuilder, didAuthSiopOpAuthenticatorMethods, getSigningAlgo, plugin_schema as 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 };