@twin.org/standards-w3c-did 0.0.2-next.3 → 0.0.2-next.5
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/cjs/index.cjs +31 -0
- package/dist/esm/index.mjs +31 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/models/IDidVerifiableCredential.d.ts +3 -71
- package/dist/types/models/IDidVerifiableCredentialCommon.d.ts +57 -0
- package/dist/types/models/IDidVerifiableCredentialV1.d.ts +21 -0
- package/dist/types/models/IDidVerifiableCredentialV2.d.ts +21 -0
- package/dist/types/models/IDidVerifiablePresentation.d.ts +3 -31
- package/dist/types/models/IDidVerifiablePresentationCommon.d.ts +23 -0
- package/dist/types/models/IDidVerifiablePresentationV1.d.ts +17 -0
- package/dist/types/models/IDidVerifiablePresentationV2.d.ts +17 -0
- package/dist/types/utils/verifiableCredentialHelper.d.ts +22 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/VerifiableCredentialHelper.md +65 -0
- package/docs/reference/index.md +9 -2
- package/docs/reference/interfaces/{IDidVerifiableCredential.md → IDidVerifiableCredentialCommon.md} +5 -32
- package/docs/reference/interfaces/IDidVerifiableCredentialV1.md +154 -0
- package/docs/reference/interfaces/IDidVerifiableCredentialV2.md +154 -0
- package/docs/reference/interfaces/{IDidVerifiablePresentation.md → IDidVerifiablePresentationCommon.md} +5 -16
- package/docs/reference/interfaces/IDidVerifiablePresentationV1.md +72 -0
- package/docs/reference/interfaces/IDidVerifiablePresentationV2.md +72 -0
- package/docs/reference/type-aliases/IDidVerifiableCredential.md +5 -0
- package/docs/reference/type-aliases/IDidVerifiablePresentation.md +5 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -515,6 +515,36 @@ class ProofHelper {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
+
// Copyright 2024 IOTA Stiftung.
|
|
519
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
520
|
+
/**
|
|
521
|
+
* Helper methods for creating and verifying proofs.
|
|
522
|
+
*/
|
|
523
|
+
class VerifiableCredentialHelper {
|
|
524
|
+
/**
|
|
525
|
+
* Runtime name for the class.
|
|
526
|
+
*/
|
|
527
|
+
static CLASS_NAME = "VerifiableCredentialHelper";
|
|
528
|
+
/**
|
|
529
|
+
* Get the valid until date from a verifiable credential.
|
|
530
|
+
* @param verifiableCredential The verifiable credential to extract the expiration date from.
|
|
531
|
+
* @returns The expiration date, if available.
|
|
532
|
+
*/
|
|
533
|
+
static getValidUntil(verifiableCredential) {
|
|
534
|
+
return (core.ObjectHelper.propertyGet(verifiableCredential, "validUntil") ??
|
|
535
|
+
core.ObjectHelper.propertyGet(verifiableCredential, "expirationDate"));
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Get the valid from from a verifiable credential.
|
|
539
|
+
* @param verifiableCredential The verifiable credential to extract the issuance date from.
|
|
540
|
+
* @returns The issuance date, if available.
|
|
541
|
+
*/
|
|
542
|
+
static getValidFrom(verifiableCredential) {
|
|
543
|
+
return (core.ObjectHelper.propertyGet(verifiableCredential, "validFrom") ??
|
|
544
|
+
core.ObjectHelper.propertyGet(verifiableCredential, "issuanceDate"));
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
518
548
|
exports.DataIntegrityProofSignerVerifier = DataIntegrityProofSignerVerifier;
|
|
519
549
|
exports.DidContexts = DidContexts;
|
|
520
550
|
exports.DidCryptoSuites = DidCryptoSuites;
|
|
@@ -524,3 +554,4 @@ exports.JsonWebSignature2020SignerVerifier = JsonWebSignature2020SignerVerifier;
|
|
|
524
554
|
exports.MultikeyHelper = MultikeyHelper;
|
|
525
555
|
exports.ProofHelper = ProofHelper;
|
|
526
556
|
exports.ProofTypes = ProofTypes;
|
|
557
|
+
exports.VerifiableCredentialHelper = VerifiableCredentialHelper;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -513,4 +513,34 @@ class ProofHelper {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
// Copyright 2024 IOTA Stiftung.
|
|
517
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
518
|
+
/**
|
|
519
|
+
* Helper methods for creating and verifying proofs.
|
|
520
|
+
*/
|
|
521
|
+
class VerifiableCredentialHelper {
|
|
522
|
+
/**
|
|
523
|
+
* Runtime name for the class.
|
|
524
|
+
*/
|
|
525
|
+
static CLASS_NAME = "VerifiableCredentialHelper";
|
|
526
|
+
/**
|
|
527
|
+
* Get the valid until date from a verifiable credential.
|
|
528
|
+
* @param verifiableCredential The verifiable credential to extract the expiration date from.
|
|
529
|
+
* @returns The expiration date, if available.
|
|
530
|
+
*/
|
|
531
|
+
static getValidUntil(verifiableCredential) {
|
|
532
|
+
return (ObjectHelper.propertyGet(verifiableCredential, "validUntil") ??
|
|
533
|
+
ObjectHelper.propertyGet(verifiableCredential, "expirationDate"));
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Get the valid from from a verifiable credential.
|
|
537
|
+
* @param verifiableCredential The verifiable credential to extract the issuance date from.
|
|
538
|
+
* @returns The issuance date, if available.
|
|
539
|
+
*/
|
|
540
|
+
static getValidFrom(verifiableCredential) {
|
|
541
|
+
return (ObjectHelper.propertyGet(verifiableCredential, "validFrom") ??
|
|
542
|
+
ObjectHelper.propertyGet(verifiableCredential, "issuanceDate"));
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export { DataIntegrityProofSignerVerifier, DidContexts, DidCryptoSuites, DidTypes, DidVerificationMethodType, JsonWebSignature2020SignerVerifier, MultikeyHelper, ProofHelper, ProofTypes, VerifiableCredentialHelper };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,7 +11,13 @@ export * from "./models/IDidLabel";
|
|
|
11
11
|
export * from "./models/IDidPresentationVerification";
|
|
12
12
|
export * from "./models/IDidService";
|
|
13
13
|
export * from "./models/IDidVerifiableCredential";
|
|
14
|
+
export * from "./models/IDidVerifiableCredentialCommon";
|
|
15
|
+
export * from "./models/IDidVerifiableCredentialV1";
|
|
16
|
+
export * from "./models/IDidVerifiableCredentialV2";
|
|
14
17
|
export * from "./models/IDidVerifiablePresentation";
|
|
18
|
+
export * from "./models/IDidVerifiablePresentationCommon";
|
|
19
|
+
export * from "./models/IDidVerifiablePresentationV1";
|
|
20
|
+
export * from "./models/IDidVerifiablePresentationV2";
|
|
15
21
|
export * from "./models/IJsonWebSignature2020Proof";
|
|
16
22
|
export * from "./models/IMultikey";
|
|
17
23
|
export * from "./models/IProof";
|
|
@@ -21,3 +27,4 @@ export * from "./signerVerifiers/dataIntegrityProofSignerVerifier";
|
|
|
21
27
|
export * from "./signerVerifiers/jsonWebSignature2020SignerVerifier";
|
|
22
28
|
export * from "./utils/multikeyHelper";
|
|
23
29
|
export * from "./utils/proofHelper";
|
|
30
|
+
export * from "./utils/verifiableCredentialHelper";
|
|
@@ -1,74 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { IDidCredentialSchema } from "./IDidCredentialSchema";
|
|
4
|
-
import type { IDidCredentialStatus } from "./IDidCredentialStatus";
|
|
5
|
-
import type { IDidLabel } from "./IDidLabel";
|
|
6
|
-
import type { IProof } from "./IProof";
|
|
1
|
+
import type { IDidVerifiableCredentialV1 } from "./IDidVerifiableCredentialV1";
|
|
2
|
+
import type { IDidVerifiableCredentialV2 } from "./IDidVerifiableCredentialV2";
|
|
7
3
|
/**
|
|
8
4
|
* Interface describing a verifiable credential.
|
|
9
|
-
* https://www.w3.org/TR/vc-data-model-2.0
|
|
10
5
|
*/
|
|
11
|
-
export
|
|
12
|
-
/**
|
|
13
|
-
* The context for the verifiable credential.
|
|
14
|
-
*/
|
|
15
|
-
"@context": typeof DidContexts.ContextVCv1 | typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv1, ...IJsonLdContextDefinitionElement[]] | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
16
|
-
/**
|
|
17
|
-
* The identifier for the verifiable credential.
|
|
18
|
-
*/
|
|
19
|
-
id?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The types of the data stored in the verifiable credential.
|
|
22
|
-
*/
|
|
23
|
-
type: string | string[];
|
|
24
|
-
/**
|
|
25
|
-
* The data for the verifiable credential.
|
|
26
|
-
*/
|
|
27
|
-
credentialSubject?: IJsonLdNodeObject | IJsonLdNodeObject[];
|
|
28
|
-
/**
|
|
29
|
-
* Used to discover information about the current status of the
|
|
30
|
-
* verifiable credential, such as whether it is suspended or revoked.
|
|
31
|
-
*/
|
|
32
|
-
credentialStatus?: IDidCredentialStatus | IDidCredentialStatus[];
|
|
33
|
-
/**
|
|
34
|
-
* Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
35
|
-
*/
|
|
36
|
-
credentialSchema?: IDidCredentialSchema | IDidCredentialSchema[];
|
|
37
|
-
/**
|
|
38
|
-
* The issuing identity.
|
|
39
|
-
*/
|
|
40
|
-
issuer?: string | {
|
|
41
|
-
id: string;
|
|
42
|
-
name?: string | IDidLabel[];
|
|
43
|
-
description?: string | IDidLabel[];
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The date the verifiable credential was issued.
|
|
47
|
-
*/
|
|
48
|
-
issuanceDate?: string;
|
|
49
|
-
/**
|
|
50
|
-
* The name of the credential.
|
|
51
|
-
*/
|
|
52
|
-
name?: string | IDidLabel[];
|
|
53
|
-
/**
|
|
54
|
-
* The description of the credential.
|
|
55
|
-
*/
|
|
56
|
-
description?: string | IDidLabel[];
|
|
57
|
-
/**
|
|
58
|
-
* The date the verifiable credential is valid from.
|
|
59
|
-
*/
|
|
60
|
-
validFrom?: string;
|
|
61
|
-
/**
|
|
62
|
-
* The date the verifiable credential is valid until.
|
|
63
|
-
*/
|
|
64
|
-
validUntil?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Evidence associated with the Credential.
|
|
67
|
-
*/
|
|
68
|
-
evidence?: IJsonLdNodeObject | IJsonLdNodeObject[];
|
|
69
|
-
/**
|
|
70
|
-
* Proofs that the verifiable credential is valid.
|
|
71
|
-
* Optional if a different proof method is used, such as JWT.
|
|
72
|
-
*/
|
|
73
|
-
proof?: IProof | IProof[];
|
|
74
|
-
}
|
|
6
|
+
export type IDidVerifiableCredential = IDidVerifiableCredentialV1 | IDidVerifiableCredentialV2;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { IDidCredentialSchema } from "./IDidCredentialSchema";
|
|
3
|
+
import type { IDidCredentialStatus } from "./IDidCredentialStatus";
|
|
4
|
+
import type { IDidLabel } from "./IDidLabel";
|
|
5
|
+
import type { IProof } from "./IProof";
|
|
6
|
+
/**
|
|
7
|
+
* Interface describing a verifiable credential.
|
|
8
|
+
* https://www.w3.org/TR/vc-data-model-2.0
|
|
9
|
+
*/
|
|
10
|
+
export interface IDidVerifiableCredentialCommon {
|
|
11
|
+
/**
|
|
12
|
+
* The identifier for the verifiable credential.
|
|
13
|
+
*/
|
|
14
|
+
id?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The types of the data stored in the verifiable credential.
|
|
17
|
+
*/
|
|
18
|
+
type: string | string[];
|
|
19
|
+
/**
|
|
20
|
+
* The data for the verifiable credential.
|
|
21
|
+
*/
|
|
22
|
+
credentialSubject?: IJsonLdNodeObject | IJsonLdNodeObject[];
|
|
23
|
+
/**
|
|
24
|
+
* Used to discover information about the current status of the
|
|
25
|
+
* verifiable credential, such as whether it is suspended or revoked.
|
|
26
|
+
*/
|
|
27
|
+
credentialStatus?: IDidCredentialStatus | IDidCredentialStatus[];
|
|
28
|
+
/**
|
|
29
|
+
* Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
30
|
+
*/
|
|
31
|
+
credentialSchema?: IDidCredentialSchema | IDidCredentialSchema[];
|
|
32
|
+
/**
|
|
33
|
+
* The issuing identity.
|
|
34
|
+
*/
|
|
35
|
+
issuer?: string | {
|
|
36
|
+
id: string;
|
|
37
|
+
name?: string | IDidLabel[];
|
|
38
|
+
description?: string | IDidLabel[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The name of the credential.
|
|
42
|
+
*/
|
|
43
|
+
name?: string | IDidLabel[];
|
|
44
|
+
/**
|
|
45
|
+
* The description of the credential.
|
|
46
|
+
*/
|
|
47
|
+
description?: string | IDidLabel[];
|
|
48
|
+
/**
|
|
49
|
+
* Evidence associated with the Credential.
|
|
50
|
+
*/
|
|
51
|
+
evidence?: IJsonLdNodeObject | IJsonLdNodeObject[];
|
|
52
|
+
/**
|
|
53
|
+
* Proofs that the verifiable credential is valid.
|
|
54
|
+
* Optional if a different proof method is used, such as JWT.
|
|
55
|
+
*/
|
|
56
|
+
proof?: IProof | IProof[];
|
|
57
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { DidContexts } from "./didContexts";
|
|
3
|
+
import type { IDidVerifiableCredentialCommon } from "./IDidVerifiableCredentialCommon";
|
|
4
|
+
/**
|
|
5
|
+
* Interface describing a verifiable credential.
|
|
6
|
+
* https://www.w3.org/TR/vc-data-model-1.1
|
|
7
|
+
*/
|
|
8
|
+
export interface IDidVerifiableCredentialV1 extends IDidVerifiableCredentialCommon {
|
|
9
|
+
/**
|
|
10
|
+
* The context for the verifiable credential.
|
|
11
|
+
*/
|
|
12
|
+
"@context": typeof DidContexts.ContextVCv1 | [typeof DidContexts.ContextVCv1, ...IJsonLdContextDefinitionElement[]];
|
|
13
|
+
/**
|
|
14
|
+
* The date the verifiable credential was issued, depending on version validFrom might be set instead.
|
|
15
|
+
*/
|
|
16
|
+
issuanceDate?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The date the verifiable credential expires, depending on version validUntil might be set instead.
|
|
19
|
+
*/
|
|
20
|
+
expirationDate?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { DidContexts } from "./didContexts";
|
|
3
|
+
import type { IDidVerifiableCredentialCommon } from "./IDidVerifiableCredentialCommon";
|
|
4
|
+
/**
|
|
5
|
+
* Interface describing a verifiable credential.
|
|
6
|
+
* https://www.w3.org/TR/vc-data-model-2.0
|
|
7
|
+
*/
|
|
8
|
+
export interface IDidVerifiableCredentialV2 extends IDidVerifiableCredentialCommon {
|
|
9
|
+
/**
|
|
10
|
+
* The context for the verifiable credential.
|
|
11
|
+
*/
|
|
12
|
+
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
13
|
+
/**
|
|
14
|
+
* The date the verifiable credential is valid from.
|
|
15
|
+
*/
|
|
16
|
+
validFrom?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The date the verifiable credential is valid until.
|
|
19
|
+
*/
|
|
20
|
+
validUntil?: string;
|
|
21
|
+
}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { IDidVerifiableCredential } from "./IDidVerifiableCredential";
|
|
4
|
-
import type { IProof } from "./IProof";
|
|
1
|
+
import type { IDidVerifiablePresentationV1 } from "./IDidVerifiablePresentationV1";
|
|
2
|
+
import type { IDidVerifiablePresentationV2 } from "./IDidVerifiablePresentationV2";
|
|
5
3
|
/**
|
|
6
4
|
* Interface describing a verifiable presentation.
|
|
7
5
|
*/
|
|
8
|
-
export
|
|
9
|
-
/**
|
|
10
|
-
* The context for the verifiable presentation.
|
|
11
|
-
*/
|
|
12
|
-
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
13
|
-
/**
|
|
14
|
-
* Provide a unique identifier for the presentation.
|
|
15
|
-
*/
|
|
16
|
-
id?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The types of the data stored in the verifiable credential.
|
|
19
|
-
*/
|
|
20
|
-
type: string | string[];
|
|
21
|
-
/**
|
|
22
|
-
* The data for the verifiable credentials.
|
|
23
|
-
*/
|
|
24
|
-
verifiableCredential?: (string | IDidVerifiableCredential)[];
|
|
25
|
-
/**
|
|
26
|
-
* The entity generating the presentation.
|
|
27
|
-
*/
|
|
28
|
-
holder?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Proofs that the verifiable presentation is valid.
|
|
31
|
-
* Optional if a different proof method is used, such as JWT.
|
|
32
|
-
*/
|
|
33
|
-
proof?: IProof | IProof[];
|
|
34
|
-
}
|
|
6
|
+
export type IDidVerifiablePresentation = IDidVerifiablePresentationV1 | IDidVerifiablePresentationV2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IProof } from "./IProof";
|
|
2
|
+
/**
|
|
3
|
+
* Interface describing a verifiable presentation.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDidVerifiablePresentationCommon {
|
|
6
|
+
/**
|
|
7
|
+
* Provide a unique identifier for the presentation.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The types of the data stored in the verifiable credential.
|
|
12
|
+
*/
|
|
13
|
+
type: string | string[];
|
|
14
|
+
/**
|
|
15
|
+
* The entity generating the presentation.
|
|
16
|
+
*/
|
|
17
|
+
holder?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Proofs that the verifiable presentation is valid.
|
|
20
|
+
* Optional if a different proof method is used, such as JWT.
|
|
21
|
+
*/
|
|
22
|
+
proof?: IProof | IProof[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { DidContexts } from "./didContexts";
|
|
3
|
+
import type { IDidVerifiableCredentialV1 } from "./IDidVerifiableCredentialV1";
|
|
4
|
+
import type { IDidVerifiablePresentationCommon } from "./IDidVerifiablePresentationCommon";
|
|
5
|
+
/**
|
|
6
|
+
* Interface describing a verifiable presentation.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDidVerifiablePresentationV1 extends IDidVerifiablePresentationCommon {
|
|
9
|
+
/**
|
|
10
|
+
* The context for the verifiable presentation.
|
|
11
|
+
*/
|
|
12
|
+
"@context": typeof DidContexts.ContextVCv1 | [typeof DidContexts.ContextVCv1, ...IJsonLdContextDefinitionElement[]];
|
|
13
|
+
/**
|
|
14
|
+
* The data for the verifiable credentials.
|
|
15
|
+
*/
|
|
16
|
+
verifiableCredential?: (string | IDidVerifiableCredentialV1)[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
|
|
2
|
+
import type { DidContexts } from "./didContexts";
|
|
3
|
+
import type { IDidVerifiableCredentialV2 } from "./IDidVerifiableCredentialV2";
|
|
4
|
+
import type { IDidVerifiablePresentationCommon } from "./IDidVerifiablePresentationCommon";
|
|
5
|
+
/**
|
|
6
|
+
* Interface describing a verifiable presentation.
|
|
7
|
+
*/
|
|
8
|
+
export interface IDidVerifiablePresentationV2 extends IDidVerifiablePresentationCommon {
|
|
9
|
+
/**
|
|
10
|
+
* The context for the verifiable presentation.
|
|
11
|
+
*/
|
|
12
|
+
"@context": typeof DidContexts.ContextVCv2 | [typeof DidContexts.ContextVCv2, ...IJsonLdContextDefinitionElement[]];
|
|
13
|
+
/**
|
|
14
|
+
* The data for the verifiable credentials.
|
|
15
|
+
*/
|
|
16
|
+
verifiableCredential?: (string | IDidVerifiableCredentialV2)[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IDidVerifiableCredential } from "../models/IDidVerifiableCredential";
|
|
2
|
+
/**
|
|
3
|
+
* Helper methods for creating and verifying proofs.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VerifiableCredentialHelper {
|
|
6
|
+
/**
|
|
7
|
+
* Runtime name for the class.
|
|
8
|
+
*/
|
|
9
|
+
static readonly CLASS_NAME: string;
|
|
10
|
+
/**
|
|
11
|
+
* Get the valid until date from a verifiable credential.
|
|
12
|
+
* @param verifiableCredential The verifiable credential to extract the expiration date from.
|
|
13
|
+
* @returns The expiration date, if available.
|
|
14
|
+
*/
|
|
15
|
+
static getValidUntil(verifiableCredential: IDidVerifiableCredential): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Get the valid from from a verifiable credential.
|
|
18
|
+
* @param verifiableCredential The verifiable credential to extract the issuance date from.
|
|
19
|
+
* @returns The issuance date, if available.
|
|
20
|
+
*/
|
|
21
|
+
static getValidFrom(verifiableCredential: IDidVerifiableCredential): string | undefined;
|
|
22
|
+
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/standards-w3c-did - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/standards/compare/standards-w3c-did-v0.0.2-next.4...standards-w3c-did-v0.0.2-next.5) (2025-09-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* separate DID VP v1 and v2 properties ([335a3c2](https://github.com/twinfoundation/standards/commit/335a3c2543ca5dbaae785568617ea85c0a8269ad))
|
|
9
|
+
|
|
10
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/standards/compare/standards-w3c-did-v0.0.2-next.3...standards-w3c-did-v0.0.2-next.4) (2025-09-12)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* separate DID VC v1 and v2 properties ([935cf0a](https://github.com/twinfoundation/standards/commit/935cf0a9cdee28c6f2d5480f1f2de126c838caf5))
|
|
16
|
+
|
|
3
17
|
## [0.0.2-next.3](https://github.com/twinfoundation/standards/compare/standards-w3c-did-v0.0.2-next.2...standards-w3c-did-v0.0.2-next.3) (2025-08-29)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Class: VerifiableCredentialHelper
|
|
2
|
+
|
|
3
|
+
Helper methods for creating and verifying proofs.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new VerifiableCredentialHelper**(): `VerifiableCredentialHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`VerifiableCredentialHelper`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### getValidUntil()
|
|
26
|
+
|
|
27
|
+
> `static` **getValidUntil**(`verifiableCredential`): `undefined` \| `string`
|
|
28
|
+
|
|
29
|
+
Get the valid until date from a verifiable credential.
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### verifiableCredential
|
|
34
|
+
|
|
35
|
+
[`IDidVerifiableCredential`](../type-aliases/IDidVerifiableCredential.md)
|
|
36
|
+
|
|
37
|
+
The verifiable credential to extract the expiration date from.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`undefined` \| `string`
|
|
42
|
+
|
|
43
|
+
The expiration date, if available.
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### getValidFrom()
|
|
48
|
+
|
|
49
|
+
> `static` **getValidFrom**(`verifiableCredential`): `undefined` \| `string`
|
|
50
|
+
|
|
51
|
+
Get the valid from from a verifiable credential.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
##### verifiableCredential
|
|
56
|
+
|
|
57
|
+
[`IDidVerifiableCredential`](../type-aliases/IDidVerifiableCredential.md)
|
|
58
|
+
|
|
59
|
+
The verifiable credential to extract the issuance date from.
|
|
60
|
+
|
|
61
|
+
#### Returns
|
|
62
|
+
|
|
63
|
+
`undefined` \| `string`
|
|
64
|
+
|
|
65
|
+
The issuance date, if available.
|
package/docs/reference/index.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
- [JsonWebSignature2020SignerVerifier](classes/JsonWebSignature2020SignerVerifier.md)
|
|
7
7
|
- [MultikeyHelper](classes/MultikeyHelper.md)
|
|
8
8
|
- [ProofHelper](classes/ProofHelper.md)
|
|
9
|
+
- [VerifiableCredentialHelper](classes/VerifiableCredentialHelper.md)
|
|
9
10
|
|
|
10
11
|
## Interfaces
|
|
11
12
|
|
|
@@ -17,14 +18,20 @@
|
|
|
17
18
|
- [IDidLabel](interfaces/IDidLabel.md)
|
|
18
19
|
- [IDidPresentationVerification](interfaces/IDidPresentationVerification.md)
|
|
19
20
|
- [IDidService](interfaces/IDidService.md)
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
21
|
+
- [IDidVerifiableCredentialCommon](interfaces/IDidVerifiableCredentialCommon.md)
|
|
22
|
+
- [IDidVerifiableCredentialV1](interfaces/IDidVerifiableCredentialV1.md)
|
|
23
|
+
- [IDidVerifiableCredentialV2](interfaces/IDidVerifiableCredentialV2.md)
|
|
24
|
+
- [IDidVerifiablePresentationCommon](interfaces/IDidVerifiablePresentationCommon.md)
|
|
25
|
+
- [IDidVerifiablePresentationV1](interfaces/IDidVerifiablePresentationV1.md)
|
|
26
|
+
- [IDidVerifiablePresentationV2](interfaces/IDidVerifiablePresentationV2.md)
|
|
22
27
|
- [IJsonWebSignature2020Proof](interfaces/IJsonWebSignature2020Proof.md)
|
|
23
28
|
- [IMultikey](interfaces/IMultikey.md)
|
|
24
29
|
- [IProofSignerVerifier](interfaces/IProofSignerVerifier.md)
|
|
25
30
|
|
|
26
31
|
## Type Aliases
|
|
27
32
|
|
|
33
|
+
- [IDidVerifiableCredential](type-aliases/IDidVerifiableCredential.md)
|
|
34
|
+
- [IDidVerifiablePresentation](type-aliases/IDidVerifiablePresentation.md)
|
|
28
35
|
- [IProof](type-aliases/IProof.md)
|
|
29
36
|
- [DidContexts](type-aliases/DidContexts.md)
|
|
30
37
|
- [DidCryptoSuites](type-aliases/DidCryptoSuites.md)
|
package/docs/reference/interfaces/{IDidVerifiableCredential.md → IDidVerifiableCredentialCommon.md}
RENAMED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
# Interface:
|
|
1
|
+
# Interface: IDidVerifiableCredentialCommon
|
|
2
2
|
|
|
3
3
|
Interface describing a verifiable credential.
|
|
4
4
|
https://www.w3.org/TR/vc-data-model-2.0
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
|
|
8
|
-
### @context
|
|
9
|
-
|
|
10
|
-
> **@context**: `"https://www.w3.org/2018/credentials/v1"` \| `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\] \| \[`"https://www.w3.org/2018/credentials/v1"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
6
|
+
## Extended by
|
|
11
7
|
|
|
12
|
-
|
|
8
|
+
- [`IDidVerifiableCredentialV1`](IDidVerifiableCredentialV1.md)
|
|
9
|
+
- [`IDidVerifiableCredentialV2`](IDidVerifiableCredentialV2.md)
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
## Properties
|
|
15
12
|
|
|
16
13
|
### id?
|
|
17
14
|
|
|
@@ -62,14 +59,6 @@ The issuing identity.
|
|
|
62
59
|
|
|
63
60
|
***
|
|
64
61
|
|
|
65
|
-
### issuanceDate?
|
|
66
|
-
|
|
67
|
-
> `optional` **issuanceDate**: `string`
|
|
68
|
-
|
|
69
|
-
The date the verifiable credential was issued.
|
|
70
|
-
|
|
71
|
-
***
|
|
72
|
-
|
|
73
62
|
### name?
|
|
74
63
|
|
|
75
64
|
> `optional` **name**: `string` \| [`IDidLabel`](IDidLabel.md)[]
|
|
@@ -86,22 +75,6 @@ The description of the credential.
|
|
|
86
75
|
|
|
87
76
|
***
|
|
88
77
|
|
|
89
|
-
### validFrom?
|
|
90
|
-
|
|
91
|
-
> `optional` **validFrom**: `string`
|
|
92
|
-
|
|
93
|
-
The date the verifiable credential is valid from.
|
|
94
|
-
|
|
95
|
-
***
|
|
96
|
-
|
|
97
|
-
### validUntil?
|
|
98
|
-
|
|
99
|
-
> `optional` **validUntil**: `string`
|
|
100
|
-
|
|
101
|
-
The date the verifiable credential is valid until.
|
|
102
|
-
|
|
103
|
-
***
|
|
104
|
-
|
|
105
78
|
### evidence?
|
|
106
79
|
|
|
107
80
|
> `optional` **evidence**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Interface: IDidVerifiableCredentialV1
|
|
2
|
+
|
|
3
|
+
Interface describing a verifiable credential.
|
|
4
|
+
https://www.w3.org/TR/vc-data-model-1.1
|
|
5
|
+
|
|
6
|
+
## Extends
|
|
7
|
+
|
|
8
|
+
- [`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md)
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
|
|
12
|
+
### id?
|
|
13
|
+
|
|
14
|
+
> `optional` **id**: `string`
|
|
15
|
+
|
|
16
|
+
The identifier for the verifiable credential.
|
|
17
|
+
|
|
18
|
+
#### Inherited from
|
|
19
|
+
|
|
20
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`id`](IDidVerifiableCredentialCommon.md#id)
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
### type
|
|
25
|
+
|
|
26
|
+
> **type**: `string` \| `string`[]
|
|
27
|
+
|
|
28
|
+
The types of the data stored in the verifiable credential.
|
|
29
|
+
|
|
30
|
+
#### Inherited from
|
|
31
|
+
|
|
32
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`type`](IDidVerifiableCredentialCommon.md#type)
|
|
33
|
+
|
|
34
|
+
***
|
|
35
|
+
|
|
36
|
+
### credentialSubject?
|
|
37
|
+
|
|
38
|
+
> `optional` **credentialSubject**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
39
|
+
|
|
40
|
+
The data for the verifiable credential.
|
|
41
|
+
|
|
42
|
+
#### Inherited from
|
|
43
|
+
|
|
44
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialSubject`](IDidVerifiableCredentialCommon.md#credentialsubject)
|
|
45
|
+
|
|
46
|
+
***
|
|
47
|
+
|
|
48
|
+
### credentialStatus?
|
|
49
|
+
|
|
50
|
+
> `optional` **credentialStatus**: [`IDidCredentialStatus`](IDidCredentialStatus.md) \| [`IDidCredentialStatus`](IDidCredentialStatus.md)[]
|
|
51
|
+
|
|
52
|
+
Used to discover information about the current status of the
|
|
53
|
+
verifiable credential, such as whether it is suspended or revoked.
|
|
54
|
+
|
|
55
|
+
#### Inherited from
|
|
56
|
+
|
|
57
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialStatus`](IDidVerifiableCredentialCommon.md#credentialstatus)
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### credentialSchema?
|
|
62
|
+
|
|
63
|
+
> `optional` **credentialSchema**: [`IDidCredentialSchema`](IDidCredentialSchema.md) \| [`IDidCredentialSchema`](IDidCredentialSchema.md)[]
|
|
64
|
+
|
|
65
|
+
Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
66
|
+
|
|
67
|
+
#### Inherited from
|
|
68
|
+
|
|
69
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialSchema`](IDidVerifiableCredentialCommon.md#credentialschema)
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### issuer?
|
|
74
|
+
|
|
75
|
+
> `optional` **issuer**: `string` \| \{ `id`: `string`; `name?`: `string` \| [`IDidLabel`](IDidLabel.md)[]; `description?`: `string` \| [`IDidLabel`](IDidLabel.md)[]; \}
|
|
76
|
+
|
|
77
|
+
The issuing identity.
|
|
78
|
+
|
|
79
|
+
#### Inherited from
|
|
80
|
+
|
|
81
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`issuer`](IDidVerifiableCredentialCommon.md#issuer)
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### name?
|
|
86
|
+
|
|
87
|
+
> `optional` **name**: `string` \| [`IDidLabel`](IDidLabel.md)[]
|
|
88
|
+
|
|
89
|
+
The name of the credential.
|
|
90
|
+
|
|
91
|
+
#### Inherited from
|
|
92
|
+
|
|
93
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`name`](IDidVerifiableCredentialCommon.md#name)
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### description?
|
|
98
|
+
|
|
99
|
+
> `optional` **description**: `string` \| [`IDidLabel`](IDidLabel.md)[]
|
|
100
|
+
|
|
101
|
+
The description of the credential.
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`description`](IDidVerifiableCredentialCommon.md#description)
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### evidence?
|
|
110
|
+
|
|
111
|
+
> `optional` **evidence**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
112
|
+
|
|
113
|
+
Evidence associated with the Credential.
|
|
114
|
+
|
|
115
|
+
#### Inherited from
|
|
116
|
+
|
|
117
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`evidence`](IDidVerifiableCredentialCommon.md#evidence)
|
|
118
|
+
|
|
119
|
+
***
|
|
120
|
+
|
|
121
|
+
### proof?
|
|
122
|
+
|
|
123
|
+
> `optional` **proof**: [`IProof`](../type-aliases/IProof.md) \| [`IProof`](../type-aliases/IProof.md)[]
|
|
124
|
+
|
|
125
|
+
Proofs that the verifiable credential is valid.
|
|
126
|
+
Optional if a different proof method is used, such as JWT.
|
|
127
|
+
|
|
128
|
+
#### Inherited from
|
|
129
|
+
|
|
130
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`proof`](IDidVerifiableCredentialCommon.md#proof)
|
|
131
|
+
|
|
132
|
+
***
|
|
133
|
+
|
|
134
|
+
### @context
|
|
135
|
+
|
|
136
|
+
> **@context**: `"https://www.w3.org/2018/credentials/v1"` \| \[`"https://www.w3.org/2018/credentials/v1"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
137
|
+
|
|
138
|
+
The context for the verifiable credential.
|
|
139
|
+
|
|
140
|
+
***
|
|
141
|
+
|
|
142
|
+
### issuanceDate?
|
|
143
|
+
|
|
144
|
+
> `optional` **issuanceDate**: `string`
|
|
145
|
+
|
|
146
|
+
The date the verifiable credential was issued, depending on version validFrom might be set instead.
|
|
147
|
+
|
|
148
|
+
***
|
|
149
|
+
|
|
150
|
+
### expirationDate?
|
|
151
|
+
|
|
152
|
+
> `optional` **expirationDate**: `string`
|
|
153
|
+
|
|
154
|
+
The date the verifiable credential expires, depending on version validUntil might be set instead.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Interface: IDidVerifiableCredentialV2
|
|
2
|
+
|
|
3
|
+
Interface describing a verifiable credential.
|
|
4
|
+
https://www.w3.org/TR/vc-data-model-2.0
|
|
5
|
+
|
|
6
|
+
## Extends
|
|
7
|
+
|
|
8
|
+
- [`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md)
|
|
9
|
+
|
|
10
|
+
## Properties
|
|
11
|
+
|
|
12
|
+
### id?
|
|
13
|
+
|
|
14
|
+
> `optional` **id**: `string`
|
|
15
|
+
|
|
16
|
+
The identifier for the verifiable credential.
|
|
17
|
+
|
|
18
|
+
#### Inherited from
|
|
19
|
+
|
|
20
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`id`](IDidVerifiableCredentialCommon.md#id)
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
### type
|
|
25
|
+
|
|
26
|
+
> **type**: `string` \| `string`[]
|
|
27
|
+
|
|
28
|
+
The types of the data stored in the verifiable credential.
|
|
29
|
+
|
|
30
|
+
#### Inherited from
|
|
31
|
+
|
|
32
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`type`](IDidVerifiableCredentialCommon.md#type)
|
|
33
|
+
|
|
34
|
+
***
|
|
35
|
+
|
|
36
|
+
### credentialSubject?
|
|
37
|
+
|
|
38
|
+
> `optional` **credentialSubject**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
39
|
+
|
|
40
|
+
The data for the verifiable credential.
|
|
41
|
+
|
|
42
|
+
#### Inherited from
|
|
43
|
+
|
|
44
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialSubject`](IDidVerifiableCredentialCommon.md#credentialsubject)
|
|
45
|
+
|
|
46
|
+
***
|
|
47
|
+
|
|
48
|
+
### credentialStatus?
|
|
49
|
+
|
|
50
|
+
> `optional` **credentialStatus**: [`IDidCredentialStatus`](IDidCredentialStatus.md) \| [`IDidCredentialStatus`](IDidCredentialStatus.md)[]
|
|
51
|
+
|
|
52
|
+
Used to discover information about the current status of the
|
|
53
|
+
verifiable credential, such as whether it is suspended or revoked.
|
|
54
|
+
|
|
55
|
+
#### Inherited from
|
|
56
|
+
|
|
57
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialStatus`](IDidVerifiableCredentialCommon.md#credentialstatus)
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### credentialSchema?
|
|
62
|
+
|
|
63
|
+
> `optional` **credentialSchema**: [`IDidCredentialSchema`](IDidCredentialSchema.md) \| [`IDidCredentialSchema`](IDidCredentialSchema.md)[]
|
|
64
|
+
|
|
65
|
+
Annotate type definitions or lock them to specific versions of the vocabulary.
|
|
66
|
+
|
|
67
|
+
#### Inherited from
|
|
68
|
+
|
|
69
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`credentialSchema`](IDidVerifiableCredentialCommon.md#credentialschema)
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### issuer?
|
|
74
|
+
|
|
75
|
+
> `optional` **issuer**: `string` \| \{ `id`: `string`; `name?`: `string` \| [`IDidLabel`](IDidLabel.md)[]; `description?`: `string` \| [`IDidLabel`](IDidLabel.md)[]; \}
|
|
76
|
+
|
|
77
|
+
The issuing identity.
|
|
78
|
+
|
|
79
|
+
#### Inherited from
|
|
80
|
+
|
|
81
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`issuer`](IDidVerifiableCredentialCommon.md#issuer)
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
85
|
+
### name?
|
|
86
|
+
|
|
87
|
+
> `optional` **name**: `string` \| [`IDidLabel`](IDidLabel.md)[]
|
|
88
|
+
|
|
89
|
+
The name of the credential.
|
|
90
|
+
|
|
91
|
+
#### Inherited from
|
|
92
|
+
|
|
93
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`name`](IDidVerifiableCredentialCommon.md#name)
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### description?
|
|
98
|
+
|
|
99
|
+
> `optional` **description**: `string` \| [`IDidLabel`](IDidLabel.md)[]
|
|
100
|
+
|
|
101
|
+
The description of the credential.
|
|
102
|
+
|
|
103
|
+
#### Inherited from
|
|
104
|
+
|
|
105
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`description`](IDidVerifiableCredentialCommon.md#description)
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### evidence?
|
|
110
|
+
|
|
111
|
+
> `optional` **evidence**: `IJsonLdNodeObject` \| `IJsonLdNodeObject`[]
|
|
112
|
+
|
|
113
|
+
Evidence associated with the Credential.
|
|
114
|
+
|
|
115
|
+
#### Inherited from
|
|
116
|
+
|
|
117
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`evidence`](IDidVerifiableCredentialCommon.md#evidence)
|
|
118
|
+
|
|
119
|
+
***
|
|
120
|
+
|
|
121
|
+
### proof?
|
|
122
|
+
|
|
123
|
+
> `optional` **proof**: [`IProof`](../type-aliases/IProof.md) \| [`IProof`](../type-aliases/IProof.md)[]
|
|
124
|
+
|
|
125
|
+
Proofs that the verifiable credential is valid.
|
|
126
|
+
Optional if a different proof method is used, such as JWT.
|
|
127
|
+
|
|
128
|
+
#### Inherited from
|
|
129
|
+
|
|
130
|
+
[`IDidVerifiableCredentialCommon`](IDidVerifiableCredentialCommon.md).[`proof`](IDidVerifiableCredentialCommon.md#proof)
|
|
131
|
+
|
|
132
|
+
***
|
|
133
|
+
|
|
134
|
+
### @context
|
|
135
|
+
|
|
136
|
+
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
137
|
+
|
|
138
|
+
The context for the verifiable credential.
|
|
139
|
+
|
|
140
|
+
***
|
|
141
|
+
|
|
142
|
+
### validFrom?
|
|
143
|
+
|
|
144
|
+
> `optional` **validFrom**: `string`
|
|
145
|
+
|
|
146
|
+
The date the verifiable credential is valid from.
|
|
147
|
+
|
|
148
|
+
***
|
|
149
|
+
|
|
150
|
+
### validUntil?
|
|
151
|
+
|
|
152
|
+
> `optional` **validUntil**: `string`
|
|
153
|
+
|
|
154
|
+
The date the verifiable credential is valid until.
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
# Interface:
|
|
1
|
+
# Interface: IDidVerifiablePresentationCommon
|
|
2
2
|
|
|
3
3
|
Interface describing a verifiable presentation.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
### @context
|
|
8
|
-
|
|
9
|
-
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
5
|
+
## Extended by
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
- [`IDidVerifiablePresentationV1`](IDidVerifiablePresentationV1.md)
|
|
8
|
+
- [`IDidVerifiablePresentationV2`](IDidVerifiablePresentationV2.md)
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
## Properties
|
|
14
11
|
|
|
15
12
|
### id?
|
|
16
13
|
|
|
@@ -28,14 +25,6 @@ The types of the data stored in the verifiable credential.
|
|
|
28
25
|
|
|
29
26
|
***
|
|
30
27
|
|
|
31
|
-
### verifiableCredential?
|
|
32
|
-
|
|
33
|
-
> `optional` **verifiableCredential**: (`string` \| [`IDidVerifiableCredential`](IDidVerifiableCredential.md))[]
|
|
34
|
-
|
|
35
|
-
The data for the verifiable credentials.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
28
|
### holder?
|
|
40
29
|
|
|
41
30
|
> `optional` **holder**: `string`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Interface: IDidVerifiablePresentationV1
|
|
2
|
+
|
|
3
|
+
Interface describing a verifiable presentation.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### id?
|
|
12
|
+
|
|
13
|
+
> `optional` **id**: `string`
|
|
14
|
+
|
|
15
|
+
Provide a unique identifier for the presentation.
|
|
16
|
+
|
|
17
|
+
#### Inherited from
|
|
18
|
+
|
|
19
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`id`](IDidVerifiablePresentationCommon.md#id)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### type
|
|
24
|
+
|
|
25
|
+
> **type**: `string` \| `string`[]
|
|
26
|
+
|
|
27
|
+
The types of the data stored in the verifiable credential.
|
|
28
|
+
|
|
29
|
+
#### Inherited from
|
|
30
|
+
|
|
31
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`type`](IDidVerifiablePresentationCommon.md#type)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### holder?
|
|
36
|
+
|
|
37
|
+
> `optional` **holder**: `string`
|
|
38
|
+
|
|
39
|
+
The entity generating the presentation.
|
|
40
|
+
|
|
41
|
+
#### Inherited from
|
|
42
|
+
|
|
43
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`holder`](IDidVerifiablePresentationCommon.md#holder)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### proof?
|
|
48
|
+
|
|
49
|
+
> `optional` **proof**: [`IProof`](../type-aliases/IProof.md) \| [`IProof`](../type-aliases/IProof.md)[]
|
|
50
|
+
|
|
51
|
+
Proofs that the verifiable presentation is valid.
|
|
52
|
+
Optional if a different proof method is used, such as JWT.
|
|
53
|
+
|
|
54
|
+
#### Inherited from
|
|
55
|
+
|
|
56
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`proof`](IDidVerifiablePresentationCommon.md#proof)
|
|
57
|
+
|
|
58
|
+
***
|
|
59
|
+
|
|
60
|
+
### @context
|
|
61
|
+
|
|
62
|
+
> **@context**: `"https://www.w3.org/2018/credentials/v1"` \| \[`"https://www.w3.org/2018/credentials/v1"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
63
|
+
|
|
64
|
+
The context for the verifiable presentation.
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### verifiableCredential?
|
|
69
|
+
|
|
70
|
+
> `optional` **verifiableCredential**: (`string` \| [`IDidVerifiableCredentialV1`](IDidVerifiableCredentialV1.md))[]
|
|
71
|
+
|
|
72
|
+
The data for the verifiable credentials.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Interface: IDidVerifiablePresentationV2
|
|
2
|
+
|
|
3
|
+
Interface describing a verifiable presentation.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- [`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md)
|
|
8
|
+
|
|
9
|
+
## Properties
|
|
10
|
+
|
|
11
|
+
### id?
|
|
12
|
+
|
|
13
|
+
> `optional` **id**: `string`
|
|
14
|
+
|
|
15
|
+
Provide a unique identifier for the presentation.
|
|
16
|
+
|
|
17
|
+
#### Inherited from
|
|
18
|
+
|
|
19
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`id`](IDidVerifiablePresentationCommon.md#id)
|
|
20
|
+
|
|
21
|
+
***
|
|
22
|
+
|
|
23
|
+
### type
|
|
24
|
+
|
|
25
|
+
> **type**: `string` \| `string`[]
|
|
26
|
+
|
|
27
|
+
The types of the data stored in the verifiable credential.
|
|
28
|
+
|
|
29
|
+
#### Inherited from
|
|
30
|
+
|
|
31
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`type`](IDidVerifiablePresentationCommon.md#type)
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### holder?
|
|
36
|
+
|
|
37
|
+
> `optional` **holder**: `string`
|
|
38
|
+
|
|
39
|
+
The entity generating the presentation.
|
|
40
|
+
|
|
41
|
+
#### Inherited from
|
|
42
|
+
|
|
43
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`holder`](IDidVerifiablePresentationCommon.md#holder)
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### proof?
|
|
48
|
+
|
|
49
|
+
> `optional` **proof**: [`IProof`](../type-aliases/IProof.md) \| [`IProof`](../type-aliases/IProof.md)[]
|
|
50
|
+
|
|
51
|
+
Proofs that the verifiable presentation is valid.
|
|
52
|
+
Optional if a different proof method is used, such as JWT.
|
|
53
|
+
|
|
54
|
+
#### Inherited from
|
|
55
|
+
|
|
56
|
+
[`IDidVerifiablePresentationCommon`](IDidVerifiablePresentationCommon.md).[`proof`](IDidVerifiablePresentationCommon.md#proof)
|
|
57
|
+
|
|
58
|
+
***
|
|
59
|
+
|
|
60
|
+
### @context
|
|
61
|
+
|
|
62
|
+
> **@context**: `"https://www.w3.org/ns/credentials/v2"` \| \[`"https://www.w3.org/ns/credentials/v2"`, `...IJsonLdContextDefinitionElement[]`\]
|
|
63
|
+
|
|
64
|
+
The context for the verifiable presentation.
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### verifiableCredential?
|
|
69
|
+
|
|
70
|
+
> `optional` **verifiableCredential**: (`string` \| [`IDidVerifiableCredentialV2`](IDidVerifiableCredentialV2.md))[]
|
|
71
|
+
|
|
72
|
+
The data for the verifiable credentials.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: IDidVerifiableCredential
|
|
2
|
+
|
|
3
|
+
> **IDidVerifiableCredential** = [`IDidVerifiableCredentialV1`](../interfaces/IDidVerifiableCredentialV1.md) \| [`IDidVerifiableCredentialV2`](../interfaces/IDidVerifiableCredentialV2.md)
|
|
4
|
+
|
|
5
|
+
Interface describing a verifiable credential.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: IDidVerifiablePresentation
|
|
2
|
+
|
|
3
|
+
> **IDidVerifiablePresentation** = [`IDidVerifiablePresentationV1`](../interfaces/IDidVerifiablePresentationV1.md) \| [`IDidVerifiablePresentationV2`](../interfaces/IDidVerifiablePresentationV2.md)
|
|
4
|
+
|
|
5
|
+
Interface describing a verifiable presentation.
|