@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.34.1-feature.SSISDK.78.306 → 0.34.1-feature.SSISDK.82.linkedVP.326

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.
@@ -1,332 +1,179 @@
1
- // import { PresentationDefinitionWithLocation, PresentationExchange } from '@sphereon/did-auth-siop'
2
- // import { SelectResults, Status, SubmissionRequirementMatch } from '@sphereon/pex'
3
- //import { Format } from '@sphereon/pex-models'
4
- // import {
5
- // //isManagedIdentifierDidResult,
6
- // isOID4VCIssuerIdentifier,
7
- // ManagedIdentifierOptsOrResult,
8
- // ManagedIdentifierResult,
9
- // } from '@sphereon/ssi-sdk-ext.identifier-resolution'
10
- // import { defaultHasher,
11
- // // ProofOptions
12
- // } from '@sphereon/ssi-sdk.core'
13
- //import { UniqueDigitalCredential, verifiableCredentialForRoleFilter } from '@sphereon/ssi-sdk.credential-store'
14
- //import { CredentialRole, FindDigitalCredentialArgs } from '@sphereon/ssi-sdk.data-store-types'
1
+ import { isManagedIdentifierDidResult, ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
2
+ import { UniqueDigitalCredential } from '@sphereon/ssi-sdk.credential-store'
3
+ import { calculateSdHash, defaultGenerateDigest, PartialSdJwtKbJwt } from '@sphereon/ssi-sdk.sd-jwt'
15
4
  import {
16
- //CompactJWT,
5
+ CredentialMapper,
6
+ DocumentFormat,
17
7
  HasherSync,
18
- //IProof, OriginalVerifiableCredential
8
+ Loggers,
9
+ OriginalVerifiableCredential,
10
+ SdJwtDecodedVerifiableCredential,
11
+ WrappedVerifiableCredential,
19
12
  } from '@sphereon/ssi-types'
20
- import {
21
- //DEFAULT_JWT_PROOF_TYPE,
22
- //IGetPresentationExchangeArgs,
23
- IOID4VPArgs,
24
- //VerifiableCredentialsWithDefinition,
25
- //VerifiablePresentationWithDefinition,
26
- } from '../types'
27
- //import { createOID4VPPresentationSignCallback } from './functions'
28
- import { OpSession } from './OpSession'
13
+ import { LOGGER_NAMESPACE, RequiredContext } from '../types'
14
+
15
+ const CLOCK_SKEW = 120
16
+ const logger = Loggers.DEFAULT.get(LOGGER_NAMESPACE)
29
17
 
30
- // FIXME SSISDK-44 add support for DCQL presentations
18
+ export interface PresentationBuilderContext {
19
+ nonce: string
20
+ audience: string // clientId or origin
21
+ agent: RequiredContext['agent']
22
+ clockSkew?: number
23
+ hasher?: HasherSync
24
+ }
31
25
 
32
- export class OID4VP {
33
- //private readonly session: OpSession
34
- // private readonly allIdentifiers: string[]
35
- // private readonly hasher?: HasherSync
26
+ /**
27
+ * Extracts the original credential from a UniqueDigitalCredential or WrappedVerifiableCredential
28
+ */
29
+ function extractOriginalCredential(
30
+ credential: UniqueDigitalCredential | WrappedVerifiableCredential | OriginalVerifiableCredential,
31
+ ): OriginalVerifiableCredential {
32
+ if (typeof credential === 'string') {
33
+ return credential
34
+ }
36
35
 
37
- private constructor(args: IOID4VPArgs) {
38
- // const { session,
39
- // // allIdentifiers, hasher = defaultHasher
40
- // } = args
41
- //this.session = session
42
- // this.allIdentifiers = allIdentifiers ?? []
43
- // this.hasher = hasher
36
+ if ('digitalCredential' in credential) {
37
+ // UniqueDigitalCredential
38
+ const udc = credential as UniqueDigitalCredential
39
+ if (udc.originalVerifiableCredential) {
40
+ return udc.originalVerifiableCredential
41
+ }
42
+ return udc.uniformVerifiableCredential as OriginalVerifiableCredential
44
43
  }
45
44
 
46
- public static async init(session: OpSession, allIdentifiers: string[], hasher?: HasherSync): Promise<OID4VP> {
47
- return new OID4VP({ session, allIdentifiers: allIdentifiers ?? (await session.getSupportedDIDs()), hasher })
45
+ if ('original' in credential) {
46
+ // WrappedVerifiableCredential
47
+ return credential.original
48
48
  }
49
49
 
50
- // public async getPresentationDefinitions(): Promise<PresentationDefinitionWithLocation[] | undefined> {
51
- // const definitions = await this.session.getPresentationDefinitions()
52
- // if (definitions) {
53
- // PresentationExchange.assertValidPresentationDefinitionWithLocations(definitions)
54
- // }
55
- // return definitions
56
- // }
50
+ // Already an OriginalVerifiableCredential
51
+ return credential as OriginalVerifiableCredential
52
+ }
53
+
54
+ /**
55
+ * Gets the issuer/holder identifier from ManagedIdentifierOptsOrResult
56
+ */
57
+ function getIdentifierString(identifier: ManagedIdentifierOptsOrResult): string {
58
+ // Check if it's a result type (has 'method' and 'opts' properties)
59
+ if ('opts' in identifier && 'method' in identifier) {
60
+ // It's a ManagedIdentifierResult
61
+ if (isManagedIdentifierDidResult(identifier)) {
62
+ return identifier.did
63
+ }
64
+ }
65
+ // For opts types or other result types, use issuer if available, otherwise kid
66
+ return identifier.issuer ?? identifier.kid ?? ''
67
+ }
68
+
69
+ /**
70
+ * Creates a Verifiable Presentation for a given credential in the appropriate format
71
+ * Ensures nonce/aud (or challenge/domain) are set according to OID4VP draft 28
72
+ */
73
+ export async function createVerifiablePresentationForFormat(
74
+ credential: UniqueDigitalCredential | WrappedVerifiableCredential | OriginalVerifiableCredential,
75
+ identifier: ManagedIdentifierOptsOrResult,
76
+ context: PresentationBuilderContext,
77
+ ): Promise<string | object> {
78
+ // FIXME find proper types
79
+ const { nonce, audience, agent, clockSkew = CLOCK_SKEW } = context
80
+
81
+ const originalCredential = extractOriginalCredential(credential)
82
+ const documentFormat = CredentialMapper.detectDocumentType(originalCredential)
83
+
84
+ logger.debug(`Creating VP for format: ${documentFormat}`)
57
85
 
58
- // private getPresentationExchange(args: IGetPresentationExchangeArgs): PresentationExchange {
59
- // const { verifiableCredentials, allIdentifiers, hasher } = args
60
- //
61
- // return new PresentationExchange({
62
- // allDIDs: allIdentifiers ?? this.allIdentifiers,
63
- // allVerifiableCredentials: verifiableCredentials,
64
- // hasher: hasher ?? this.hasher,
65
- // })
66
- // }
86
+ switch (documentFormat) {
87
+ case DocumentFormat.SD_JWT_VC: {
88
+ // SD-JWT with KB-JWT
89
+ const decodedSdJwt = await CredentialMapper.decodeSdJwtVcAsync(
90
+ typeof originalCredential === 'string' ? originalCredential : (originalCredential as SdJwtDecodedVerifiableCredential).compactSdJwtVc,
91
+ defaultGenerateDigest,
92
+ )
67
93
 
68
- // public async createVerifiablePresentations(
69
- // credentialRole: CredentialRole,
70
- // credentialsWithDefinitions: VerifiableCredentialsWithDefinition[],
71
- // opts?: {
72
- // forceNoCredentialsInVP?: boolean // Allow to create a VP without credentials, like EBSI is using it. Defaults to false
73
- // restrictToFormats?: Format
74
- // restrictToDIDMethods?: string[]
75
- // proofOpts?: ProofOptions
76
- // idOpts?: ManagedIdentifierOptsOrResult
77
- // skipDidResolution?: boolean
78
- // holderDID?: string
79
- // subjectIsHolder?: boolean
80
- // hasher?: HasherSync
81
- // applyFilter?: boolean
82
- // },
83
- // ): Promise<VerifiablePresentationWithDefinition[]> {
84
- // return await Promise.all(credentialsWithDefinitions.map((cred) => this.createVerifiablePresentation(credentialRole, cred, opts)))
85
- // }
94
+ const hashAlg = decodedSdJwt.signedPayload._sd_alg ?? 'sha-256'
95
+ const sdHash = calculateSdHash(decodedSdJwt.compactSdJwtVc, hashAlg, defaultGenerateDigest)
86
96
 
87
- // public async createVerifiablePresentation(
88
- // credentialRole: CredentialRole,
89
- // selectedVerifiableCredentials: VerifiableCredentialsWithDefinition,
90
- // opts?: {
91
- // forceNoCredentialsInVP?: boolean // Allow to create a VP without credentials, like EBSI is using it. Defaults to false
92
- // restrictToFormats?: Format
93
- // restrictToDIDMethods?: string[]
94
- // proofOpts?: ProofOptions
95
- // idOpts?: ManagedIdentifierOptsOrResult
96
- // skipDidResolution?: boolean
97
- // holder?: string
98
- // subjectIsHolder?: boolean
99
- // applyFilter?: boolean
100
- // hasher?: HasherSync
101
- // },
102
- // ): Promise<VerifiablePresentationWithDefinition> {
103
- // const { subjectIsHolder, holder, forceNoCredentialsInVP = false } = { ...opts }
104
- // if (subjectIsHolder && holder) {
105
- // throw Error('Cannot both have subject is holder and a holderDID value at the same time (programming error)')
106
- // }
107
- // if (forceNoCredentialsInVP) {
108
- // selectedVerifiableCredentials.credentials = []
109
- // } else if (!selectedVerifiableCredentials?.credentials || selectedVerifiableCredentials.credentials.length === 0) {
110
- // throw Error('No verifiable verifiableCredentials provided for presentation definition')
111
- // }
112
- //
113
- // // const proofOptions: ProofOptions = {
114
- // // ...opts?.proofOpts,
115
- // // challenge: opts?.proofOpts?.nonce ?? opts?.proofOpts?.challenge ?? this.session.nonce,
116
- // // domain: opts?.proofOpts?.domain ?? (await this.session.getRedirectUri()),
117
- // // }
118
- //
119
- // let idOpts = opts?.idOpts
120
- // if (!idOpts) {
121
- // if (opts?.subjectIsHolder) {
122
- // if (forceNoCredentialsInVP) {
123
- // return Promise.reject(
124
- // Error(
125
- // `Cannot have subject is holder, when force no credentials is being used, as we could never determine the holder then. Please provide holderDID`,
126
- // ),
127
- // )
128
- // }
129
- // const firstUniqueDC = selectedVerifiableCredentials.credentials[0]
130
- // // const firstVC = firstUniqueDC.uniformVerifiableCredential!
131
- // if (typeof firstUniqueDC !== 'object' || !('digitalCredential' in firstUniqueDC)) {
132
- // return Promise.reject(Error('If no opts provided, credentials should be of type UniqueDigitalCredential'))
133
- // }
134
- //
135
- // idOpts = isOID4VCIssuerIdentifier(firstUniqueDC.digitalCredential.kmsKeyRef)
136
- // ? await this.session.context.agent.identifierManagedGetByIssuer({
137
- // identifier: firstUniqueDC.digitalCredential.kmsKeyRef,
138
- // })
139
- // : await this.session.context.agent.identifierManagedGetByKid({
140
- // identifier: firstUniqueDC.digitalCredential.kmsKeyRef,
141
- // kmsKeyRef: firstUniqueDC.digitalCredential.kmsKeyRef,
142
- // })
143
- //
144
- // /*
145
- // const holder = CredentialMapper.isSdJwtDecodedCredential(firstVC)
146
- // ? firstVC.decodedPayload.cnf?.jwk
147
- // ? //TODO SDK-19: convert the JWK to hex and search for the appropriate key and associated DID
148
- // //doesn't apply to did:jwk only, as you can represent any DID key as a JWK. So whenever you encounter a JWK it doesn't mean it had to come from a did:jwk in the system. It just can always be represented as a did:jwk
149
- // `did:jwk:${encodeJoseBlob(firstVC.decodedPayload.cnf?.jwk)}#0`
150
- // : firstVC.decodedPayload.sub
151
- // : Array.isArray(firstVC.credentialSubject)
152
- // ? firstVC.credentialSubject[0].id
153
- // : firstVC.credentialSubject.id
154
- // if (holder) {
155
- // idOpts = { identifier: holder }
156
- // }
157
- // */
158
- // } else if (opts?.holder) {
159
- // idOpts = { identifier: opts.holder }
160
- // }
161
- // }
162
- //
163
- // // We are making sure to filter, in case the user submitted all verifiableCredentials in the wallet/agent. We also make sure to get original formats back
164
- // const vcs = forceNoCredentialsInVP
165
- // ? selectedVerifiableCredentials
166
- // : opts?.applyFilter
167
- // ? await this.filterCredentials(credentialRole, selectedVerifiableCredentials.dcqlQuery, {
168
- // restrictToFormats: opts?.restrictToFormats,
169
- // restrictToDIDMethods: opts?.restrictToDIDMethods,
170
- // filterOpts: {
171
- // verifiableCredentials: selectedVerifiableCredentials.credentials,
172
- // },
173
- // })
174
- // : {
175
- // definition: selectedVerifiableCredentials.dcqlQuery,
176
- // credentials: selectedVerifiableCredentials.credentials,
177
- // }
178
- //
179
- // if (!idOpts) {
180
- // return Promise.reject(Error(`No identifier options present at this point`))
181
- // }
182
- //
183
- // // const signCallback = await createOID4VPPresentationSignCallback({
184
- // // presentationSignCallback: this.session.options.presentationSignCallback,
185
- // // idOpts,
186
- // // context: this.session.context,
187
- // // domain: proofOptions.domain,
188
- // // challenge: proofOptions.challenge,
189
- // // format: opts?.restrictToFormats ?? selectedVerifiableCredentials.dcqlQuery.dcqlQuery.format,
190
- // // skipDidResolution: opts?.skipDidResolution ?? false,
191
- // // })
192
- // const identifier: ManagedIdentifierResult = await this.session.context.agent.identifierManagedGet(idOpts)
193
- // const verifiableCredentials = vcs.credentials.map((credential) =>
194
- // typeof credential === 'object' && 'digitalCredential' in credential ? credential.originalVerifiableCredential! : credential,
195
- // )
196
- // // const presentationResult = await this.getPresentationExchange({
197
- // // verifiableCredentials: verifiableCredentials,
198
- // // allIdentifiers: this.allIdentifiers,
199
- // // hasher: opts?.hasher,
200
- // // }).createVerifiablePresentation(vcs.dcqlQuery.dcqlQuery, verifiableCredentials, signCallback, {
201
- // // proofOptions,
202
- // // // fixme: Update to newer siop-vp to not require dids here. But when Veramo is creating the VP it's still looking at this field to pass into didManagerGet
203
- // // ...(identifier && isManagedIdentifierDidResult(identifier) && { holderDID: identifier.did }),
204
- // // })
205
- //
206
- // const verifiablePresentations = presentationResult.verifiablePresentations.map((verifiablePresentation) =>
207
- // typeof verifiablePresentation !== 'string' &&
208
- // 'proof' in verifiablePresentation &&
209
- // 'jwt' in verifiablePresentation.proof &&
210
- // verifiablePresentation.proof.jwt
211
- // ? verifiablePresentation.proof.jwt
212
- // : verifiablePresentation,
213
- // )
214
- //
215
- // return {
216
- // ...presentationResult,
217
- // verifiablePresentations,
218
- // verifiableCredentials: verifiableCredentials,
219
- // dcqlQuery: selectedVerifiableCredentials.dcqlQuery,
220
- // idOpts,
221
- // }
222
- // }
97
+ const kbJwtPayload: PartialSdJwtKbJwt['payload'] = {
98
+ iat: Math.floor(Date.now() / 1000 - clockSkew),
99
+ sd_hash: sdHash,
100
+ nonce, // Always use the Authorization Request nonce
101
+ aud: audience, // Always use the Client Identifier or Origin
102
+ }
223
103
 
224
- // public async filterCredentialsAgainstAllDefinitions(
225
- // credentialRole: CredentialRole,
226
- // opts?: {
227
- // filterOpts?: {
228
- // verifiableCredentials?: UniqueDigitalCredential[]
229
- // filter?: FindDigitalCredentialArgs
230
- // }
231
- // holderDIDs?: string[]
232
- // restrictToFormats?: Format
233
- // restrictToDIDMethods?: string[]
234
- // },
235
- // ): Promise<VerifiableCredentialsWithDefinition[]> {
236
- // const defs = await this.getPresentationDefinitions()
237
- // const result: VerifiableCredentialsWithDefinition[] = []
238
- // if (defs) {
239
- // for (const definition of defs) {
240
- // result.push(await this.filterCredentials(credentialRole, definition, opts))
241
- // }
242
- // }
243
- // return result
244
- // }
104
+ const presentationResult = await agent.createSdJwtPresentation({
105
+ presentation: decodedSdJwt.compactSdJwtVc,
106
+ kb: {
107
+ payload: kbJwtPayload as any, // FIXME
108
+ },
109
+ })
245
110
 
246
- // public async filterCredentials(
247
- // credentialRole: CredentialRole,
248
- // presentationDefinition: PresentationDefinitionWithLocation,
249
- // opts?: {
250
- // filterOpts?: { verifiableCredentials?: (UniqueDigitalCredential | OriginalVerifiableCredential)[]; filter?: FindDigitalCredentialArgs }
251
- // holderDIDs?: string[]
252
- // restrictToFormats?: Format
253
- // restrictToDIDMethods?: string[]
254
- // },
255
- // ): Promise<VerifiableCredentialsWithDefinition> {
256
- // const udcMap = new Map<OriginalVerifiableCredential, UniqueDigitalCredential | OriginalVerifiableCredential>()
257
- // opts?.filterOpts?.verifiableCredentials?.forEach((credential) => {
258
- // if (typeof credential === 'object' && 'digitalCredential' in credential) {
259
- // udcMap.set(credential.originalVerifiableCredential!, credential)
260
- // } else {
261
- // udcMap.set(credential, credential)
262
- // }
263
- // })
264
- //
265
- // const credentials = (
266
- // await this.filterCredentialsWithSelectionStatus(credentialRole, presentationDefinition, {
267
- // ...opts,
268
- // filterOpts: {
269
- // verifiableCredentials: opts?.filterOpts?.verifiableCredentials?.map((credential) => {
270
- // if (typeof credential === 'object' && 'digitalCredential' in credential) {
271
- // return credential.originalVerifiableCredential!
272
- // } else {
273
- // return credential
274
- // }
275
- // }),
276
- // },
277
- // })
278
- // ).verifiableCredential
279
- //
280
- // return {
281
- // dcqlQuery: presentationDefinition,
282
- // credentials: credentials?.map((vc) => udcMap.get(vc)!) ?? [],
283
- // }
284
- // }
111
+ return presentationResult.presentation
112
+ }
285
113
 
286
- // public async filterCredentialsWithSelectionStatus(
287
- // credentialRole: CredentialRole,
288
- // presentationDefinition: PresentationDefinitionWithLocation,
289
- // opts?: {
290
- // filterOpts?: { verifiableCredentials?: OriginalVerifiableCredential[]; filter?: FindDigitalCredentialArgs }
291
- // holderDIDs?: string[]
292
- // restrictToFormats?: Format
293
- // restrictToDIDMethods?: string[]
294
- // },
295
- // ): Promise<SelectResults> {
296
- // const selectionResults: SelectResults = await this.getPresentationExchange({
297
- // verifiableCredentials: await this.getCredentials(credentialRole, opts?.filterOpts),
298
- // }).selectVerifiableCredentialsForSubmission(presentationDefinition.definition, opts)
299
- // if (selectionResults.errors && selectionResults.errors.length > 0) {
300
- // throw Error(JSON.stringify(selectionResults.errors))
301
- // } else if (selectionResults.areRequiredCredentialsPresent === Status.ERROR) {
302
- // throw Error(`Not all required credentials are available to satisfy the relying party's request`)
303
- // }
304
- //
305
- // const matches: SubmissionRequirementMatch[] | undefined = selectionResults.matches
306
- // if (!matches || matches.length === 0 || !selectionResults.verifiableCredential || selectionResults.verifiableCredential.length === 0) {
307
- // throw Error(JSON.stringify(selectionResults.errors))
308
- // }
309
- // return selectionResults
310
- // }
311
- //
312
- // private async getCredentials(
313
- // credentialRole: CredentialRole,
314
- // filterOpts?: {
315
- // verifiableCredentials?: OriginalVerifiableCredential[]
316
- // filter?: FindDigitalCredentialArgs
317
- // },
318
- // ): Promise<OriginalVerifiableCredential[]> {
319
- // if (filterOpts?.verifiableCredentials && filterOpts.verifiableCredentials.length > 0) {
320
- // return filterOpts.verifiableCredentials
321
- // }
322
- //
323
- // const filter = verifiableCredentialForRoleFilter(credentialRole, filterOpts?.filter)
324
- // const uniqueCredentials = await this.session.context.agent.crsGetUniqueCredentials({ filter })
325
- // return uniqueCredentials.map((uniqueVC: UniqueDigitalCredential) => {
326
- // const vc = uniqueVC.uniformVerifiableCredential!
327
- // const proof = Array.isArray(vc.proof) ? vc.proof : [vc.proof]
328
- // const jwtProof = proof.find((p: IProof) => p?.type === DEFAULT_JWT_PROOF_TYPE)
329
- // return jwtProof ? (jwtProof.jwt as CompactJWT) : vc
330
- // })
331
- // }
114
+ case DocumentFormat.JSONLD: {
115
+ // JSON-LD VC - create JSON-LD VP with challenge and domain in proof
116
+ const vcObject = typeof originalCredential === 'string' ? JSON.parse(originalCredential) : originalCredential
117
+
118
+ const vpObject = {
119
+ '@context': ['https://www.w3.org/2018/credentials/v1'],
120
+ type: ['VerifiablePresentation'],
121
+ verifiableCredential: [vcObject],
122
+ }
123
+
124
+ // Create JSON-LD VP with proof
125
+ return await agent.createVerifiablePresentation({
126
+ presentation: vpObject,
127
+ proofFormat: 'lds',
128
+ challenge: nonce, // Authorization Request nonce as challenge
129
+ domain: audience, // Client Identifier or Origin as domain
130
+ keyRef: identifier.kmsKeyRef || identifier.kid,
131
+ })
132
+ }
133
+
134
+ case DocumentFormat.MSO_MDOC: {
135
+ // ISO mdoc - create mdoc VP token
136
+ // This is a placeholder implementation
137
+ // Full implementation would require:
138
+ // 1. Decode the mdoc using CredentialMapper or mdoc utilities
139
+ // 2. Build proper mdoc VP token with session transcript
140
+ // 3. Include nonce/audience in the session transcript
141
+ logger.warning('mso_mdoc format has basic support - production use requires proper mdoc VP token implementation')
142
+
143
+ return originalCredential
144
+ }
145
+
146
+ default: {
147
+ // JWT VC - create JWT VP with nonce and aud in payload
148
+ const vcJwt = typeof originalCredential === 'string' ? originalCredential : JSON.stringify(originalCredential)
149
+
150
+ const identifierString = getIdentifierString(identifier)
151
+
152
+ // Create VP JWT using agent method
153
+ const vpPayload = {
154
+ iss: identifierString,
155
+ aud: audience, // Client Identifier or Origin
156
+ nonce, // Authorization Request nonce
157
+ vp: {
158
+ '@context': ['https://www.w3.org/2018/credentials/v1'],
159
+ type: ['VerifiablePresentation'],
160
+ holder: identifierString,
161
+ verifiableCredential: [vcJwt],
162
+ },
163
+ iat: Math.floor(Date.now() / 1000 - clockSkew),
164
+ exp: Math.floor(Date.now() / 1000 + 600 + clockSkew), // 10 minutes
165
+ }
166
+
167
+ // Use the agent's JWT creation capability
168
+ const vpJwt = await agent.createVerifiablePresentation({
169
+ presentation: vpPayload.vp,
170
+ proofFormat: 'jwt',
171
+ domain: audience,
172
+ challenge: nonce,
173
+ keyRef: identifier.kmsKeyRef || identifier.kid,
174
+ })
175
+
176
+ return vpJwt.proof?.jwt || vpJwt
177
+ }
178
+ }
332
179
  }
@@ -7,26 +7,18 @@ import {
7
7
  SupportedVersion,
8
8
  URI,
9
9
  Verification,
10
- VerifiedAuthorizationRequest
10
+ VerifiedAuthorizationRequest,
11
11
  } from '@sphereon/did-auth-siop'
12
12
  import { ResolveOpts } from '@sphereon/did-auth-siop-adapter'
13
13
  import { JwtIssuer } from '@sphereon/oid4vc-common'
14
14
  import { getAgentDIDMethods, getAgentResolver } from '@sphereon/ssi-sdk-ext.did-utils'
15
15
  import { JweAlg, JweEnc } from '@sphereon/ssi-sdk-ext.jwt-service'
16
16
  import { encodeBase64url } from '@sphereon/ssi-sdk.core'
17
- import { parseDid } from '@sphereon/ssi-types'
17
+ import { Loggers, parseDid } from '@sphereon/ssi-types'
18
18
  import { IIdentifier, TKeyType } from '@veramo/core'
19
19
  import { v4 } from 'uuid'
20
- import {
21
- IOPOptions,
22
- IOpSessionArgs,
23
- IOpSessionGetOID4VPArgs,
24
- IOpsSendSiopAuthorizationResponseArgs,
25
- IRequiredContext
26
- } from '../types'
20
+ import { IOPOptions, IOpSessionArgs, IOpsSendSiopAuthorizationResponseArgs, IRequiredContext } from '../types'
27
21
  import { createOP } from './functions'
28
- import { OID4VP } from './OID4VP'
29
- import { Loggers } from '@sphereon/ssi-types'
30
22
 
31
23
  const logger = Loggers.DEFAULT.get('sphereon:oid4vp:OpSession')
32
24
 
@@ -213,10 +205,6 @@ export class OpSession {
213
205
  return Promise.resolve(this.verifiedAuthorizationRequest!.responseURI!)
214
206
  }
215
207
 
216
- public async getOID4VP(args: IOpSessionGetOID4VPArgs): Promise<OID4VP> {
217
- return await OID4VP.init(this, args.allIdentifiers ?? [], args.hasher)
218
- }
219
-
220
208
  private async createJarmResponseCallback({
221
209
  responseOpts,
222
210
  }: {
@@ -259,11 +247,7 @@ export class OpSession {
259
247
  }
260
248
 
261
249
  public async sendAuthorizationResponse(args: IOpsSendSiopAuthorizationResponseArgs): Promise<Response> {
262
- const {
263
- responseSignerOpts,
264
- dcqlResponse,
265
- isFirstParty,
266
- } = args
250
+ const { responseSignerOpts, dcqlResponse, isFirstParty } = args
267
251
 
268
252
  const resolveOpts: ResolveOpts = this.options.resolveOpts ?? {
269
253
  resolver: getAgentResolver(this.context, {