@sphereon/ssi-sdk.credential-vcdm-jsonld-provider 0.33.1-feature.jose.vcdm.62 → 0.33.1-feature.jose.vcdm.64
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/issue-verify-flow-statuslist.test.ts +1 -3
- package/src/agent/CredentialProviderJsonld.ts +0 -1
- package/src/enums.ts +0 -1
- package/src/ld-context-loader.ts +0 -2
- package/src/ld-credential-module.ts +2 -9
- package/src/ld-document-loader.ts +10 -1
- package/src/ld-suite-loader.ts +6 -10
- package/src/suites/Ed25519Signature2020.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.credential-vcdm-jsonld-provider",
|
|
3
|
-
"version": "0.33.1-feature.jose.vcdm.
|
|
3
|
+
"version": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"@noble/hashes": "1.6.1",
|
|
43
43
|
"@sphereon/ssi-sdk-ext.did-utils": "0.28.1-feature.jose.vcdm.25",
|
|
44
44
|
"@sphereon/ssi-sdk-ext.key-utils": "0.28.1-feature.jose.vcdm.25",
|
|
45
|
-
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.jose.vcdm.
|
|
46
|
-
"@sphereon/ssi-sdk.core": "0.33.1-feature.jose.vcdm.
|
|
47
|
-
"@sphereon/ssi-sdk.credential-vcdm": "0.33.1-feature.jose.vcdm.
|
|
48
|
-
"@sphereon/ssi-sdk.data-store": "0.33.1-feature.jose.vcdm.
|
|
49
|
-
"@sphereon/ssi-sdk.vc-status-list": "0.33.1-feature.jose.vcdm.
|
|
50
|
-
"@sphereon/ssi-types": "0.33.1-feature.jose.vcdm.
|
|
45
|
+
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
46
|
+
"@sphereon/ssi-sdk.core": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
47
|
+
"@sphereon/ssi-sdk.credential-vcdm": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
48
|
+
"@sphereon/ssi-sdk.data-store": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
49
|
+
"@sphereon/ssi-sdk.vc-status-list": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
50
|
+
"@sphereon/ssi-types": "0.33.1-feature.jose.vcdm.64+3c61dc9b",
|
|
51
51
|
"@veramo-community/lds-ecdsa-secp256k1-recovery2020": "github:uport-project/EcdsaSecp256k1RecoverySignature2020",
|
|
52
52
|
"@veramo/core": "4.2.0",
|
|
53
53
|
"@veramo/utils": "4.2.0",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"react-native-securerandom": "^1.0.1"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "3c61dc9bd9aa7ebe2b4e88c6fd37aed7d4338dfb"
|
|
122
122
|
}
|
|
@@ -12,7 +12,6 @@ import { CredentialProviderJsonld } from '../agent'
|
|
|
12
12
|
import { LdDefaultContexts } from '../ld-default-contexts'
|
|
13
13
|
import { SphereonEd25519Signature2018, SphereonEd25519Signature2020 } from '../suites'
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
import { bedrijfsInformatieV1, exampleV1 } from './mocks'
|
|
17
16
|
import { ContextDoc, IVcdmCredentialPlugin, VcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm'
|
|
18
17
|
import { SphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager'
|
|
@@ -56,8 +55,7 @@ describe('credential-LD full flow', () => {
|
|
|
56
55
|
}),
|
|
57
56
|
}),
|
|
58
57
|
new IdentifierResolution({}),
|
|
59
|
-
new VcdmCredentialPlugin({issuers: [jsonld]})
|
|
60
|
-
|
|
58
|
+
new VcdmCredentialPlugin({ issuers: [jsonld] }),
|
|
61
59
|
],
|
|
62
60
|
})
|
|
63
61
|
didKeyIdentifier = await agent.didManagerCreate({ options: { type: 'Ed25519' } })
|
|
@@ -156,7 +156,6 @@ export class CredentialProviderJsonld implements IVcdmCredentialProvider {
|
|
|
156
156
|
delete presentation.issuanceDate
|
|
157
157
|
delete presentation.validFrom
|
|
158
158
|
|
|
159
|
-
|
|
160
159
|
let identifier: IIdentifier
|
|
161
160
|
try {
|
|
162
161
|
identifier = await context.agent.didManagerGet({ did: holder })
|
package/src/enums.ts
CHANGED
|
@@ -5,7 +5,6 @@ export const ControllerProofPurpose = sigpkg.purposes.ControllerProofPurpose
|
|
|
5
5
|
export const AssertionProofPurpose = sigpkg.purposes.AssertionProofPurpose
|
|
6
6
|
export const AuthenticationProofPurpose = sigpkg.purposes.AuthenticationProofPurpose
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* Plugin method map interface
|
|
11
10
|
* @public
|
package/src/ld-context-loader.ts
CHANGED
|
@@ -66,17 +66,13 @@ export class LdCredentialModule {
|
|
|
66
66
|
const purpose = args.purpose
|
|
67
67
|
debug(`Issue VC method called for ${key.kid}...`)
|
|
68
68
|
// TODO: try multiple matching suites until one works or list is exhausted
|
|
69
|
-
const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(
|
|
70
|
-
key.type,
|
|
71
|
-
key.meta?.verificationMethod?.type ?? '',
|
|
72
|
-
)[0]
|
|
69
|
+
const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? '')[0]
|
|
73
70
|
|
|
74
71
|
const documentLoader = this.ldDocumentLoader.getLoader(context, {
|
|
75
72
|
attemptToFetchContexts: true,
|
|
76
73
|
verifiableData: credential,
|
|
77
74
|
})
|
|
78
75
|
|
|
79
|
-
|
|
80
76
|
// some suites can modify the incoming credential (e.g. add required contexts)
|
|
81
77
|
suite.preSigningCredModification(credential)
|
|
82
78
|
debug(`Signing suite will be retrieved for ${verificationMethodId}...`)
|
|
@@ -131,10 +127,7 @@ export class LdCredentialModule {
|
|
|
131
127
|
context: IVcdmIssuerAgentContext,
|
|
132
128
|
): Promise<VerifiablePresentationSP> {
|
|
133
129
|
// TODO: try multiple matching suites until one works or list is exhausted
|
|
134
|
-
const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(
|
|
135
|
-
key.type,
|
|
136
|
-
key.meta?.verificationMethod?.type ?? '',
|
|
137
|
-
)[0]
|
|
130
|
+
const suite = this.ldSuiteLoader.getSignatureSuiteForKeyType(key.type, key.meta?.verificationMethod?.type ?? '')[0]
|
|
138
131
|
const documentLoader = this.ldDocumentLoader.getLoader(context, {
|
|
139
132
|
attemptToFetchContexts: true,
|
|
140
133
|
verifiableData: presentation,
|
|
@@ -43,7 +43,16 @@ export class LdDocumentLoader {
|
|
|
43
43
|
{
|
|
44
44
|
attemptToFetchContexts = false,
|
|
45
45
|
verifiableData,
|
|
46
|
-
}: {
|
|
46
|
+
}: {
|
|
47
|
+
attemptToFetchContexts: boolean
|
|
48
|
+
verifiableData:
|
|
49
|
+
| VerifiableCredential
|
|
50
|
+
| VerifiableCredentialSP
|
|
51
|
+
| VerifiablePresentation
|
|
52
|
+
| VerifiablePresentationSP
|
|
53
|
+
| CredentialPayload
|
|
54
|
+
| PresentationPayload
|
|
55
|
+
},
|
|
47
56
|
) {
|
|
48
57
|
return sigpkg.extendContextLoader(async (url: string) => {
|
|
49
58
|
if (!url || url.trim().length === 0) {
|
package/src/ld-suite-loader.ts
CHANGED
|
@@ -29,17 +29,13 @@ export class LdSuiteLoader {
|
|
|
29
29
|
private signatureMap: Record<string, Record<string, SphereonLdSignature[]>> = {}
|
|
30
30
|
|
|
31
31
|
getSignatureSuiteForKeyType(keyType: TKeyType, verificationType?: string): SphereonLdSignature[] {
|
|
32
|
-
// Always use verification type if supplied. This is the type denoted by the DID verification method type
|
|
33
|
-
|
|
34
|
-
/* let verificationSuite = verificationType
|
|
35
|
-
if (verificationSuite === 'Secp256k1VerificationKey2018' || verificationSuite === 'Secp256r1VerificationKey2018') {
|
|
36
|
-
verificationSuite = 'JsonWebKey2020'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const suite = verificationSuite && this.signatureMap[verificationSuite] ? this.signatureMap[verificationSuite] : this.signatureMap[keyType]
|
|
40
|
-
if (suite) return suite*/
|
|
32
|
+
// Always use verification type if supplied. This is the type denoted by the DID verification method type.
|
|
33
|
+
// The only exception is JsonWebKey. We do not have a signature suite anymore for that (discontinued), so we take the first verification suite in that case. Just like no verification method was supplied
|
|
41
34
|
const verificationToSuites = this.signatureMap[keyType]
|
|
42
|
-
const suites =
|
|
35
|
+
const suites =
|
|
36
|
+
verificationType && verificationType !== '' && verificationType !== 'JsonWebKey2020'
|
|
37
|
+
? verificationToSuites[verificationType]
|
|
38
|
+
: Object.values(verificationToSuites)?.[0]
|
|
43
39
|
// const suite = this.signatureMap[keyType]?.[verificationType]
|
|
44
40
|
if (Array.isArray(suites) && suites.length > 0) {
|
|
45
41
|
return suites
|