@veramo/credential-ld 3.1.1-next.8

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.
Files changed (55) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +6 -0
  3. package/build/action-handler.d.ts +28 -0
  4. package/build/action-handler.d.ts.map +1 -0
  5. package/build/action-handler.js +155 -0
  6. package/build/action-handler.js.map +1 -0
  7. package/build/index.d.ts +15 -0
  8. package/build/index.d.ts.map +1 -0
  9. package/build/index.js +31 -0
  10. package/build/index.js.map +1 -0
  11. package/build/ld-context-loader.d.ts +16 -0
  12. package/build/ld-context-loader.d.ts.map +1 -0
  13. package/build/ld-context-loader.js +33 -0
  14. package/build/ld-context-loader.js.map +1 -0
  15. package/build/ld-credential-module.d.ts +25 -0
  16. package/build/ld-credential-module.d.ts.map +1 -0
  17. package/build/ld-credential-module.js +148 -0
  18. package/build/ld-credential-module.js.map +1 -0
  19. package/build/ld-default-contexts.d.ts +2 -0
  20. package/build/ld-default-contexts.d.ts.map +1 -0
  21. package/build/ld-default-contexts.js +42 -0
  22. package/build/ld-default-contexts.js.map +1 -0
  23. package/build/ld-suite-loader.d.ts +15 -0
  24. package/build/ld-suite-loader.d.ts.map +1 -0
  25. package/build/ld-suite-loader.js +28 -0
  26. package/build/ld-suite-loader.js.map +1 -0
  27. package/build/ld-suites.d.ts +13 -0
  28. package/build/ld-suites.d.ts.map +1 -0
  29. package/build/ld-suites.js +15 -0
  30. package/build/ld-suites.js.map +1 -0
  31. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts +11 -0
  32. package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts.map +1 -0
  33. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +100 -0
  34. package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -0
  35. package/build/suites/Ed25519Signature2018.d.ts +11 -0
  36. package/build/suites/Ed25519Signature2018.d.ts.map +1 -0
  37. package/build/suites/Ed25519Signature2018.js +92 -0
  38. package/build/suites/Ed25519Signature2018.js.map +1 -0
  39. package/build/tsdoc-metadata.json +11 -0
  40. package/build/types.d.ts +174 -0
  41. package/build/types.d.ts.map +1 -0
  42. package/build/types.js +3 -0
  43. package/build/types.js.map +1 -0
  44. package/package.json +50 -0
  45. package/plugin.schema.json +398 -0
  46. package/src/action-handler.ts +229 -0
  47. package/src/index.ts +14 -0
  48. package/src/ld-context-loader.ts +29 -0
  49. package/src/ld-credential-module.ts +170 -0
  50. package/src/ld-default-contexts.ts +21 -0
  51. package/src/ld-suite-loader.ts +29 -0
  52. package/src/ld-suites.ts +45 -0
  53. package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +83 -0
  54. package/src/suites/Ed25519Signature2018.ts +75 -0
  55. package/src/types.ts +208 -0
@@ -0,0 +1,174 @@
1
+ import { CredentialPayload, IAgentContext, IDIDManager, IKeyManager, IPluginMethodMap, IResolver, PresentationPayload, VerifiableCredential, VerifiablePresentation } from '@veramo/core';
2
+ /**
3
+ * The interface definition for a plugin that can issue and verify Verifiable Credentials and Presentations
4
+ * that use JSON-LD format.
5
+ *
6
+ * @remarks Please see {@link https://www.w3.org/TR/vc-data-model | W3C Verifiable Credentials data model}
7
+ *
8
+ * @beta This API is likely to change without a BREAKING CHANGE notice
9
+ */
10
+ export interface ICredentialIssuerLD extends IPluginMethodMap {
11
+ /**
12
+ * Creates a Verifiable Presentation.
13
+ * The payload, signer and format are chosen based on the `args` parameter.
14
+ *
15
+ * @param args - Arguments necessary to create the Presentation.
16
+ * @param context - This reserved param is automatically added and handled by the framework, *do not override*
17
+ *
18
+ * @returns - a promise that resolves to the {@link @veramo/core#VerifiablePresentation} that was requested or rejects with an error
19
+ * if there was a problem with the input or while getting the key to sign
20
+ *
21
+ * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#presentations | Verifiable Presentation data model }
22
+ *
23
+ * @beta This API is likely to change without a BREAKING CHANGE notice
24
+ */
25
+ createVerifiablePresentationLD(args: ICreateVerifiablePresentationLDArgs, context: IRequiredContext): Promise<VerifiablePresentation>;
26
+ /**
27
+ * Creates a Verifiable Credential.
28
+ * The payload, signer and format are chosen based on the `args` parameter.
29
+ *
30
+ * @param args - Arguments necessary to create the Presentation.
31
+ * @param context - This reserved param is automatically added and handled by the framework, *do not override*
32
+ *
33
+ * @returns - a promise that resolves to the {@link @veramo/core#VerifiableCredential} that was requested or rejects with an error
34
+ * if there was a problem with the input or while getting the key to sign
35
+ *
36
+ * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#credentials | Verifiable Credential data model}
37
+ *
38
+ * @beta This API is likely to change without a BREAKING CHANGE notice
39
+ */
40
+ createVerifiableCredentialLD(args: ICreateVerifiableCredentialLDArgs, context: IRequiredContext): Promise<VerifiableCredential>;
41
+ /**
42
+ * Verifies a Verifiable Credential JWT or LDS Format.
43
+ *
44
+ * @param args - Arguments necessary to verify a VerifiableCredential
45
+ * @param context - This reserved param is automatically added and handled by the framework, *do not override*
46
+ *
47
+ * @returns - a promise that resolves to the boolean true on successful verification or rejects on error
48
+ *
49
+ * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#credentials | Verifiable Credential data model}
50
+ *
51
+ * @beta This API is likely to change without a BREAKING CHANGE notice
52
+ */
53
+ verifyCredentialLD(args: IVerifyCredentialLDArgs, context: IRequiredContext): Promise<boolean>;
54
+ /**
55
+ * Verifies a Verifiable Presentation JWT or LDS Format.
56
+ *
57
+ * @param args - Arguments necessary to verify a VerifiableCredential
58
+ * @param context - This reserved param is automatically added and handled by the framework, *do not override*
59
+ *
60
+ * @returns - a promise that resolves to the boolean true on successful verification or rejects on error
61
+ *
62
+ * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#presentations | Verifiable Credential data model}
63
+ *
64
+ * @beta This API is likely to change without a BREAKING CHANGE notice
65
+ */
66
+ verifyPresentationLD(args: IVerifyPresentationLDArgs, context: IRequiredContext): Promise<boolean>;
67
+ }
68
+ /**
69
+ * Encapsulates the parameters required to create a
70
+ * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation}
71
+ *
72
+ * @beta This API is likely to change without a BREAKING CHANGE notice
73
+ */
74
+ export interface ICreateVerifiablePresentationLDArgs {
75
+ /**
76
+ * The json payload of the Presentation according to the
77
+ * {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model}.
78
+ *
79
+ * The signer of the Presentation is chosen based on the `holder` property
80
+ * of the `presentation`
81
+ *
82
+ * '@context', 'type' and 'issuanceDate' will be added automatically if omitted
83
+ */
84
+ presentation: PresentationPayload;
85
+ /**
86
+ * Optional (only JWT) string challenge parameter to add to the verifiable presentation.
87
+ */
88
+ challenge?: string;
89
+ /**
90
+ * Optional string domain parameter to add to the verifiable presentation.
91
+ */
92
+ domain?: string;
93
+ /**
94
+ * Optional. The key handle ({@link IKey#kid}) from the internal database.
95
+ */
96
+ keyRef?: string;
97
+ }
98
+ /**
99
+ * Encapsulates the parameters required to create a
100
+ * {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential}
101
+ *
102
+ * @beta This API is likely to change without a BREAKING CHANGE notice
103
+ */
104
+ export interface ICreateVerifiableCredentialLDArgs {
105
+ /**
106
+ * The json payload of the Credential according to the
107
+ * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
108
+ *
109
+ * The signer of the Credential is chosen based on the `issuer.id` property
110
+ * of the `credential`
111
+ *
112
+ * '@context', 'type' and 'issuanceDate' will be added automatically if omitted
113
+ */
114
+ credential: CredentialPayload;
115
+ /**
116
+ * Optional. The key handle ({@link IKey#kid}) from the internal database.
117
+ */
118
+ keyRef?: string;
119
+ }
120
+ /**
121
+ * Encapsulates the parameters required to verify a
122
+ * {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential}
123
+ *
124
+ * @beta This API is likely to change without a BREAKING CHANGE notice
125
+ */
126
+ export interface IVerifyCredentialLDArgs {
127
+ /**
128
+ * The json payload of the Credential according to the
129
+ * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
130
+ *
131
+ * The signer of the Credential is chosen based on the `issuer.id` property
132
+ * of the `credential`
133
+ *
134
+ */
135
+ credential: VerifiableCredential;
136
+ }
137
+ /**
138
+ * Encapsulates the parameters required to verify a
139
+ * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation}
140
+ *
141
+ * @beta This API is likely to change without a BREAKING CHANGE notice
142
+ */
143
+ export interface IVerifyPresentationLDArgs {
144
+ /**
145
+ * The json payload of the Credential according to the
146
+ * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model}
147
+ *
148
+ * The signer of the Credential is chosen based on the `issuer.id` property
149
+ * of the `credential`
150
+ *
151
+ */
152
+ presentation: VerifiablePresentation;
153
+ /**
154
+ * Optional (only for JWT) string challenge parameter to verify the verifiable presentation against
155
+ */
156
+ challenge?: string;
157
+ /**
158
+ * Optional (only for JWT) string domain parameter to verify the verifiable presentation against
159
+ */
160
+ domain?: string;
161
+ }
162
+ /**
163
+ * Represents the requirements that this plugin has.
164
+ * The agent that is using this plugin is expected to provide these methods.
165
+ *
166
+ * This interface can be used for static type checks, to make sure your application is properly initialized.
167
+ *
168
+ * @beta This API is likely to change without a BREAKING CHANGE notice
169
+ */
170
+ export declare type IRequiredContext = IAgentContext<IResolver & Pick<IDIDManager, 'didManagerGet'> & Pick<IKeyManager, 'keyManagerGet' | 'keyManagerSign'>>;
171
+ export declare type ContextDoc = {
172
+ '@context': Record<string, any>;
173
+ };
174
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EAEX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAErB;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;;;;;;;;;;OAaG;IACH,8BAA8B,CAC5B,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAElC;;;;;;;;;;;;;OAaG;IACH,4BAA4B,CAC1B,IAAI,EAAE,iCAAiC,EACvC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,oBAAoB,CAAC,CAAA;IAEhC;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE9F;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACnG;AAED;;;;;GAKG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;;;;;OAQG;IACH,YAAY,EAAE,mBAAmB,CAAA;IAEjC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;OAQG;IACH,UAAU,EAAE,iBAAiB,CAAA;IAE7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,UAAU,EAAE,oBAAoB,CAAA;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;OAOG;IACH,YAAY,EAAE,sBAAsB,CAAA;IAEpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,oBAAY,gBAAgB,GAAG,aAAa,CAC1C,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,eAAe,GAAG,gBAAgB,CAAC,CACvG,CAAA;AAED,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAChC,CAAA"}
package/build/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@veramo/credential-ld",
3
+ "description": "Veramo plugin for working with W3C JSON-LD Verifiable Credentials & Presentations.",
4
+ "version": "3.1.1-next.8+18c2226e",
5
+ "main": "build/index.js",
6
+ "types": "build/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "generate-plugin-schema": "yarn veramo dev generate-plugin-schema"
10
+ },
11
+ "veramo": {
12
+ "pluginInterfaces": {
13
+ "ICredentialIssuerLD": "./src/action-handler.ts"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "@transmute/credentials-context": "^0.7.0-unstable.26",
18
+ "@transmute/ed25519-signature-2018": "^0.7.0-unstable.27",
19
+ "@transmute/lds-ecdsa-secp256k1-recovery2020": "^0.0.7",
20
+ "@veramo/core": "^3.1.1-next.8+18c2226e",
21
+ "@veramo/did-resolver": "^3.1.1-next.8+18c2226e",
22
+ "@veramo/utils": "^3.1.1-next.8+18c2226e",
23
+ "debug": "^4.1.1",
24
+ "did-resolver": "3.1.3",
25
+ "jsonld": "^5.2.0",
26
+ "jsonld-signatures": "^9.0.2",
27
+ "uint8arrays": "^2.1.3",
28
+ "vc-js": "^0.6.4"
29
+ },
30
+ "devDependencies": {
31
+ "@types/debug": "4.1.7",
32
+ "borc": "^3.0.0",
33
+ "typescript": "4.4.4"
34
+ },
35
+ "files": [
36
+ "build/**/*",
37
+ "src/**/*",
38
+ "plugin.schema.json",
39
+ "README.md",
40
+ "LICENSE"
41
+ ],
42
+ "publishConfig": {
43
+ "access": "public"
44
+ },
45
+ "repository": "git@github.com:uport-project/veramo.git",
46
+ "author": "Mircea Nistor <mircea.nistor@mesh.xyz>",
47
+ "license": "Apache-2.0",
48
+ "keywords": [],
49
+ "gitHead": "18c2226e375925446be8c1d15cd5bab4387b8d79"
50
+ }
@@ -0,0 +1,398 @@
1
+ {
2
+ "ICredentialIssuerLD": {
3
+ "components": {
4
+ "schemas": {
5
+ "ICreateVerifiableCredentialLDArgs": {
6
+ "type": "object",
7
+ "properties": {
8
+ "credential": {
9
+ "$ref": "#/components/schemas/CredentialPayload",
10
+ "description": "The json payload of the Credential according to the\n {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`\n\n'@context', 'type' and 'issuanceDate' will be added automatically if omitted"
11
+ },
12
+ "keyRef": {
13
+ "type": "string",
14
+ "description": "Optional. The key handle ( {@link IKey#kid } ) from the internal database."
15
+ }
16
+ },
17
+ "required": [
18
+ "credential"
19
+ ],
20
+ "description": "Encapsulates the parameters required to create a\n {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential }"
21
+ },
22
+ "CredentialPayload": {
23
+ "type": "object",
24
+ "properties": {
25
+ "issuer": {
26
+ "$ref": "#/components/schemas/IssuerType"
27
+ },
28
+ "credentialSubject": {
29
+ "$ref": "#/components/schemas/CredentialSubject"
30
+ },
31
+ "type": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string"
35
+ }
36
+ },
37
+ "@context": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ "issuanceDate": {
44
+ "$ref": "#/components/schemas/DateType"
45
+ },
46
+ "expirationDate": {
47
+ "$ref": "#/components/schemas/DateType"
48
+ },
49
+ "credentialStatus": {
50
+ "$ref": "#/components/schemas/CredentialStatus"
51
+ },
52
+ "id": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "required": [
57
+ "issuer"
58
+ ],
59
+ "description": "Used as input when creating Verifiable Credentials"
60
+ },
61
+ "IssuerType": {
62
+ "anyOf": [
63
+ {
64
+ "type": "object",
65
+ "properties": {
66
+ "id": {
67
+ "type": "string"
68
+ }
69
+ },
70
+ "required": [
71
+ "id"
72
+ ]
73
+ },
74
+ {
75
+ "type": "string"
76
+ }
77
+ ],
78
+ "description": "The issuer of a Credential or the holder of a Presentation.\n\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#issuer | Issuer data model }"
79
+ },
80
+ "CredentialSubject": {
81
+ "type": "object",
82
+ "properties": {
83
+ "id": {
84
+ "type": "string"
85
+ }
86
+ },
87
+ "description": "The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#credential-subject | Credential Subject }"
88
+ },
89
+ "DateType": {
90
+ "type": "string",
91
+ "description": "Represents an issuance or expiration date for Credentials / Presentations. This is used as input when creating them."
92
+ },
93
+ "CredentialStatus": {
94
+ "type": "object",
95
+ "properties": {
96
+ "id": {
97
+ "type": "string"
98
+ },
99
+ "type": {
100
+ "type": "string"
101
+ }
102
+ },
103
+ "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }"
104
+ },
105
+ "VerifiableCredential": {
106
+ "type": "object",
107
+ "properties": {
108
+ "proof": {
109
+ "$ref": "#/components/schemas/ProofType"
110
+ },
111
+ "issuer": {
112
+ "$ref": "#/components/schemas/IssuerType"
113
+ },
114
+ "credentialSubject": {
115
+ "$ref": "#/components/schemas/CredentialSubject"
116
+ },
117
+ "type": {
118
+ "anyOf": [
119
+ {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string"
123
+ }
124
+ },
125
+ {
126
+ "type": "string"
127
+ }
128
+ ]
129
+ },
130
+ "@context": {
131
+ "anyOf": [
132
+ {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "string"
136
+ }
137
+ },
138
+ {
139
+ "type": "string"
140
+ }
141
+ ]
142
+ },
143
+ "issuanceDate": {
144
+ "type": "string"
145
+ },
146
+ "expirationDate": {
147
+ "type": "string"
148
+ },
149
+ "credentialStatus": {
150
+ "$ref": "#/components/schemas/CredentialStatus"
151
+ },
152
+ "id": {
153
+ "type": "string"
154
+ }
155
+ },
156
+ "required": [
157
+ "@context",
158
+ "credentialSubject",
159
+ "issuanceDate",
160
+ "issuer",
161
+ "proof"
162
+ ],
163
+ "description": "Represents a signed Verifiable Credential payload (includes proof), using a JSON representation. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model }"
164
+ },
165
+ "ProofType": {
166
+ "type": "object",
167
+ "properties": {
168
+ "type": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "description": "A proof property of a Verifiable Credential or Presentation"
173
+ },
174
+ "ICreateVerifiablePresentationLDArgs": {
175
+ "type": "object",
176
+ "properties": {
177
+ "presentation": {
178
+ "$ref": "#/components/schemas/PresentationPayload",
179
+ "description": "The json payload of the Presentation according to the\n {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model } .\n\nThe signer of the Presentation is chosen based on the `holder` property of the `presentation`\n\n'@context', 'type' and 'issuanceDate' will be added automatically if omitted"
180
+ },
181
+ "challenge": {
182
+ "type": "string",
183
+ "description": "Optional (only JWT) string challenge parameter to add to the verifiable presentation."
184
+ },
185
+ "domain": {
186
+ "type": "string",
187
+ "description": "Optional string domain parameter to add to the verifiable presentation."
188
+ },
189
+ "keyRef": {
190
+ "type": "string",
191
+ "description": "Optional. The key handle ( {@link IKey#kid } ) from the internal database."
192
+ }
193
+ },
194
+ "required": [
195
+ "presentation"
196
+ ],
197
+ "description": "Encapsulates the parameters required to create a\n {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation }"
198
+ },
199
+ "PresentationPayload": {
200
+ "type": "object",
201
+ "properties": {
202
+ "holder": {
203
+ "type": "string"
204
+ },
205
+ "verifiableCredential": {
206
+ "type": "array",
207
+ "items": {
208
+ "$ref": "#/components/schemas/W3CVerifiableCredential"
209
+ }
210
+ },
211
+ "type": {
212
+ "type": "array",
213
+ "items": {
214
+ "type": "string"
215
+ }
216
+ },
217
+ "@context": {
218
+ "type": "array",
219
+ "items": {
220
+ "type": "string"
221
+ }
222
+ },
223
+ "verifier": {
224
+ "type": "array",
225
+ "items": {
226
+ "type": "string"
227
+ }
228
+ },
229
+ "issuanceDate": {
230
+ "$ref": "#/components/schemas/DateType"
231
+ },
232
+ "expirationDate": {
233
+ "$ref": "#/components/schemas/DateType"
234
+ },
235
+ "id": {
236
+ "type": "string"
237
+ }
238
+ },
239
+ "required": [
240
+ "holder"
241
+ ],
242
+ "description": "Used as input when creating Verifiable Presentations"
243
+ },
244
+ "W3CVerifiableCredential": {
245
+ "anyOf": [
246
+ {
247
+ "$ref": "#/components/schemas/VerifiableCredential"
248
+ },
249
+ {
250
+ "$ref": "#/components/schemas/CompactJWT"
251
+ }
252
+ ],
253
+ "description": "Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model } \nSee {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats }"
254
+ },
255
+ "CompactJWT": {
256
+ "type": "string",
257
+ "description": "Represents a Json Web Token in compact form. \"header.payload.signature\""
258
+ },
259
+ "VerifiablePresentation": {
260
+ "type": "object",
261
+ "properties": {
262
+ "proof": {
263
+ "$ref": "#/components/schemas/ProofType"
264
+ },
265
+ "holder": {
266
+ "type": "string"
267
+ },
268
+ "verifiableCredential": {
269
+ "type": "array",
270
+ "items": {
271
+ "$ref": "#/components/schemas/W3CVerifiableCredential"
272
+ }
273
+ },
274
+ "type": {
275
+ "anyOf": [
276
+ {
277
+ "type": "array",
278
+ "items": {
279
+ "type": "string"
280
+ }
281
+ },
282
+ {
283
+ "type": "string"
284
+ }
285
+ ]
286
+ },
287
+ "@context": {
288
+ "anyOf": [
289
+ {
290
+ "type": "array",
291
+ "items": {
292
+ "type": "string"
293
+ }
294
+ },
295
+ {
296
+ "type": "string"
297
+ }
298
+ ]
299
+ },
300
+ "verifier": {
301
+ "type": "array",
302
+ "items": {
303
+ "type": "string"
304
+ }
305
+ },
306
+ "issuanceDate": {
307
+ "type": "string"
308
+ },
309
+ "expirationDate": {
310
+ "type": "string"
311
+ },
312
+ "id": {
313
+ "type": "string"
314
+ }
315
+ },
316
+ "required": [
317
+ "@context",
318
+ "holder",
319
+ "proof"
320
+ ],
321
+ "description": "Represents a signed Verifiable Presentation (includes proof), using a JSON representation. See {@link https://www.w3.org/TR/vc-data-model/#presentations | VP data model }"
322
+ },
323
+ "IVerifyCredentialLDArgs": {
324
+ "type": "object",
325
+ "properties": {
326
+ "credential": {
327
+ "$ref": "#/components/schemas/VerifiableCredential",
328
+ "description": "The json payload of the Credential according to the\n {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`"
329
+ }
330
+ },
331
+ "required": [
332
+ "credential"
333
+ ],
334
+ "description": "Encapsulates the parameters required to verify a\n {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential }"
335
+ },
336
+ "IVerifyPresentationLDArgs": {
337
+ "type": "object",
338
+ "properties": {
339
+ "presentation": {
340
+ "$ref": "#/components/schemas/VerifiablePresentation",
341
+ "description": "The json payload of the Credential according to the\n {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model } \n\nThe signer of the Credential is chosen based on the `issuer.id` property of the `credential`"
342
+ },
343
+ "challenge": {
344
+ "type": "string",
345
+ "description": "Optional (only for JWT) string challenge parameter to verify the verifiable presentation against"
346
+ },
347
+ "domain": {
348
+ "type": "string",
349
+ "description": "Optional (only for JWT) string domain parameter to verify the verifiable presentation against"
350
+ }
351
+ },
352
+ "required": [
353
+ "presentation"
354
+ ],
355
+ "description": "Encapsulates the parameters required to verify a\n {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation }"
356
+ }
357
+ },
358
+ "methods": {
359
+ "createVerifiableCredentialLD": {
360
+ "description": "Creates a Verifiable Credential. The payload, signer and format are chosen based on the ",
361
+ "arguments": {
362
+ "$ref": "#/components/schemas/ICreateVerifiableCredentialLDArgs"
363
+ },
364
+ "returnType": {
365
+ "$ref": "#/components/schemas/VerifiableCredential"
366
+ }
367
+ },
368
+ "createVerifiablePresentationLD": {
369
+ "description": "Creates a Verifiable Presentation. The payload, signer and format are chosen based on the ",
370
+ "arguments": {
371
+ "$ref": "#/components/schemas/ICreateVerifiablePresentationLDArgs"
372
+ },
373
+ "returnType": {
374
+ "$ref": "#/components/schemas/VerifiablePresentation"
375
+ }
376
+ },
377
+ "verifyCredentialLD": {
378
+ "description": "Verifies a Verifiable Credential JWT or LDS Format.",
379
+ "arguments": {
380
+ "$ref": "#/components/schemas/IVerifyCredentialLDArgs"
381
+ },
382
+ "returnType": {
383
+ "type": "boolean"
384
+ }
385
+ },
386
+ "verifyPresentationLD": {
387
+ "description": "Verifies a Verifiable Presentation JWT or LDS Format.",
388
+ "arguments": {
389
+ "$ref": "#/components/schemas/IVerifyPresentationLDArgs"
390
+ },
391
+ "returnType": {
392
+ "type": "boolean"
393
+ }
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }