@sphereon/ssi-sdk.mdl-mdoc 0.34.1-feature.SSISDK.26.RP.55 → 0.34.1-feature.SSISDK.26.RP.57
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.cjs +21 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -51
- package/dist/index.d.ts +51 -51
- package/dist/index.js +21 -19
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/agent/mDLMdoc.ts +5 -4
- package/src/types/ImDLMdoc.ts +27 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.mdl-mdoc",
|
|
3
|
-
"version": "0.34.1-feature.SSISDK.26.RP.
|
|
3
|
+
"version": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
31
31
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
32
32
|
"@sphereon/pex-models": "^2.3.2",
|
|
33
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.26.RP.
|
|
34
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-feature.SSISDK.26.RP.
|
|
35
|
-
"@sphereon/ssi-sdk-ext.x509-utils": "0.34.1-feature.SSISDK.26.RP.
|
|
36
|
-
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.26.RP.
|
|
37
|
-
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.26.RP.
|
|
33
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
34
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
35
|
+
"@sphereon/ssi-sdk-ext.x509-utils": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
36
|
+
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
37
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
38
38
|
"@veramo/core": "4.2.0",
|
|
39
39
|
"@veramo/did-manager": "4.2.0",
|
|
40
40
|
"@veramo/utils": "4.2.0",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@sphereon/oid4vci-client": "0.19.1-feature.SSISDK.13.32",
|
|
51
51
|
"@sphereon/oid4vci-common": "0.19.1-feature.SSISDK.13.32",
|
|
52
|
-
"@sphereon/ssi-express-support": "0.34.1-feature.SSISDK.26.RP.
|
|
53
|
-
"@sphereon/ssi-sdk-ext.key-manager": "0.34.1-feature.SSISDK.26.RP.
|
|
54
|
-
"@sphereon/ssi-sdk-ext.kms-local": "0.34.1-feature.SSISDK.26.RP.
|
|
55
|
-
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.26.RP.
|
|
56
|
-
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.26.RP.
|
|
57
|
-
"@sphereon/ssi-sdk.public-key-hosting": "0.34.1-feature.SSISDK.26.RP.
|
|
52
|
+
"@sphereon/ssi-express-support": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
53
|
+
"@sphereon/ssi-sdk-ext.key-manager": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
54
|
+
"@sphereon/ssi-sdk-ext.kms-local": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
55
|
+
"@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
56
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
57
|
+
"@sphereon/ssi-sdk.public-key-hosting": "0.34.1-feature.SSISDK.26.RP.57+9836fe9c",
|
|
58
58
|
"@transmute/json-web-signature": "0.7.0-unstable.81",
|
|
59
59
|
"@types/cors": "^2.8.17",
|
|
60
60
|
"@types/express": "^4.17.21",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"EBSI",
|
|
90
90
|
"EBSI Authorization Client"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "9836fe9c1ba582b925c14e88fb09c43938edd9b2"
|
|
93
93
|
}
|
package/src/agent/mDLMdoc.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mdocPkg from '@sphereon/kmp-mdoc-core'
|
|
2
|
+
const { com } = mdocPkg
|
|
2
3
|
import { calculateJwkThumbprint } from '@sphereon/ssi-sdk-ext.key-utils'
|
|
3
4
|
import { CertificateInfo, getCertificateInfo, pemOrDerToX509Certificate, X509ValidationResult } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
4
5
|
import { JWK } from '@sphereon/ssi-types'
|
|
@@ -121,7 +122,7 @@ export class MDLMdoc implements IAgentPlugin {
|
|
|
121
122
|
presentationDefinition as IOid4VPPresentationDefinition,
|
|
122
123
|
)
|
|
123
124
|
const docsAndDescriptors: DocumentDescriptorMatchResult[] = []
|
|
124
|
-
let lastError:
|
|
125
|
+
let lastError: mdocPkg.com.sphereon.crypto.generic.IVerifyResults<mdocPkg.com.sphereon.crypto.cose.ICoseKeyCbor> | undefined = undefined
|
|
125
126
|
for (let match of allMatches) {
|
|
126
127
|
if (match.document) {
|
|
127
128
|
const result = await validate(match.document)
|
|
@@ -194,7 +195,7 @@ export class MDLMdoc implements IAgentPlugin {
|
|
|
194
195
|
*/
|
|
195
196
|
private async mdocOid4vpRPVerify(args: MdocOid4vpRPVerifyArgs, _context: IRequiredContext): Promise<MdocOid4vpRPVerifyResult> {
|
|
196
197
|
const { vp_token, presentation_submission, trustAnchors } = args
|
|
197
|
-
const deviceResponse =
|
|
198
|
+
const deviceResponse = com.sphereon.mdoc.data.device.DeviceResponseCbor.Static.cborDecode(decodeFrom(vp_token, Encoding.BASE64URL))
|
|
198
199
|
if (!deviceResponse.documents) {
|
|
199
200
|
return Promise.reject(Error(`No documents found in vp_token`))
|
|
200
201
|
}
|
|
@@ -252,7 +253,7 @@ export class MDLMdoc implements IAgentPlugin {
|
|
|
252
253
|
const { input, keyInfo, requireX5Chain } = args
|
|
253
254
|
const coseKeyInfo = keyInfo && CoseJoseKeyMappingService.toCoseKeyInfo(keyInfo)
|
|
254
255
|
const verification = await new CoseCryptoServiceJS(new CoseCryptoService(context)).verify1(
|
|
255
|
-
|
|
256
|
+
com.sphereon.crypto.cose.CoseSign1Json.Static.fromDTO(input).toCbor(),
|
|
256
257
|
coseKeyInfo,
|
|
257
258
|
requireX5Chain,
|
|
258
259
|
)
|
package/src/types/ImDLMdoc.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mdocPkg from '@sphereon/kmp-mdoc-core'
|
|
2
|
+
const { com } = mdocPkg
|
|
2
3
|
import { PresentationDefinitionV2, PresentationSubmission } from '@sphereon/pex-models'
|
|
3
4
|
import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager'
|
|
4
5
|
import { CertificateInfo, SubjectAlternativeGeneralName, X509ValidationResult } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
5
6
|
import { IAgentContext, IDIDManager, IPluginMethodMap, IResolver } from '@veramo/core'
|
|
6
|
-
export type IKey =
|
|
7
|
-
export type CoseSign1Json =
|
|
8
|
-
export type CoseSign1Cbor<Any> =
|
|
9
|
-
export type ICoseKeyCbor =
|
|
10
|
-
export type ICoseKeyJson =
|
|
11
|
-
export type IKeyInfo<KT extends IKey = IKey> =
|
|
12
|
-
export type IVerifyResults<KT extends IKey> =
|
|
13
|
-
export type IVerifySignatureResult<KT extends IKey> =
|
|
14
|
-
export type DocumentJson =
|
|
15
|
-
export type DocumentCbor =
|
|
16
|
-
export const CborByteString =
|
|
17
|
-
export const CoseKeyCbor =
|
|
18
|
-
export const CoseCryptoServiceJS =
|
|
19
|
-
export const CoseJoseKeyMappingService =
|
|
20
|
-
export const KeyInfo =
|
|
21
|
-
export const DateTimeUtils =
|
|
22
|
-
export const decodeFrom =
|
|
23
|
-
export const encodeTo =
|
|
24
|
-
export const Encoding =
|
|
25
|
-
export const MdocValidations =
|
|
26
|
-
export const MdocOid4vpService =
|
|
27
|
-
export const Jwk =
|
|
28
|
-
export type DocumentDescriptorMatchResult =
|
|
29
|
-
export type IOid4VPPresentationDefinition =
|
|
30
|
-
export const Oid4VPPresentationSubmission =
|
|
7
|
+
export type IKey = mdocPkg.com.sphereon.crypto.IKey
|
|
8
|
+
export type CoseSign1Json = mdocPkg.com.sphereon.crypto.cose.CoseSign1Json
|
|
9
|
+
export type CoseSign1Cbor<Any> = mdocPkg.com.sphereon.crypto.cose.CoseSign1Cbor<Any>
|
|
10
|
+
export type ICoseKeyCbor = mdocPkg.com.sphereon.crypto.cose.ICoseKeyCbor
|
|
11
|
+
export type ICoseKeyJson = mdocPkg.com.sphereon.crypto.cose.ICoseKeyJson
|
|
12
|
+
export type IKeyInfo<KT extends IKey = IKey> = mdocPkg.com.sphereon.crypto.IKeyInfo<KT>
|
|
13
|
+
export type IVerifyResults<KT extends IKey> = mdocPkg.com.sphereon.crypto.generic.IVerifyResults<KT>
|
|
14
|
+
export type IVerifySignatureResult<KT extends IKey> = mdocPkg.com.sphereon.crypto.generic.IVerifySignatureResult<KT>
|
|
15
|
+
export type DocumentJson = mdocPkg.com.sphereon.mdoc.data.device.DocumentJson
|
|
16
|
+
export type DocumentCbor = mdocPkg.com.sphereon.mdoc.data.device.DocumentCbor
|
|
17
|
+
export const CborByteString = com.sphereon.cbor.CborByteString
|
|
18
|
+
export const CoseKeyCbor = com.sphereon.crypto.cose.CoseKeyCbor
|
|
19
|
+
export const CoseCryptoServiceJS = com.sphereon.crypto.CoseCryptoServiceJS
|
|
20
|
+
export const CoseJoseKeyMappingService = com.sphereon.crypto.CoseJoseKeyMappingService
|
|
21
|
+
export const KeyInfo = com.sphereon.crypto.KeyInfo
|
|
22
|
+
export const DateTimeUtils = com.sphereon.kmp.DateTimeUtils
|
|
23
|
+
export const decodeFrom = com.sphereon.kmp.decodeFrom
|
|
24
|
+
export const encodeTo = com.sphereon.kmp.encodeTo
|
|
25
|
+
export const Encoding = com.sphereon.kmp.Encoding
|
|
26
|
+
export const MdocValidations = com.sphereon.mdoc.data.MdocValidations
|
|
27
|
+
export const MdocOid4vpService = com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs
|
|
28
|
+
export const Jwk = com.sphereon.crypto.jose.Jwk
|
|
29
|
+
export type DocumentDescriptorMatchResult = mdocPkg.com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult
|
|
30
|
+
export type IOid4VPPresentationDefinition = mdocPkg.com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition
|
|
31
|
+
export const Oid4VPPresentationSubmission = com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission
|
|
31
32
|
|
|
32
33
|
export interface ImDLMdoc extends IPluginMethodMap {
|
|
33
34
|
// TODO: Extract cert methods to its own plugin
|