@sphereon/ssi-sdk.credential-vcdm-jsonld-provider 0.33.1-feature.jose.vcdm.59
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/LICENSE +201 -0
- package/README.md +287 -0
- package/dist/index.cjs +3147 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +222 -0
- package/dist/index.d.ts +222 -0
- package/dist/index.js +3117 -0
- package/dist/index.js.map +1 -0
- package/package.json +122 -0
- package/plugin.schema.json +12425 -0
- package/src/__tests__/context.loader.test.ts +41 -0
- package/src/__tests__/diwala.test.ts +129 -0
- package/src/__tests__/fixtures/diwala.ts +43 -0
- package/src/__tests__/issue-verify-flow-statuslist.test.ts +94 -0
- package/src/__tests__/issue-verify-flow-vcdm2.test.ts +268 -0
- package/src/__tests__/issue-verify-flow.test.ts +306 -0
- package/src/__tests__/localAgent.test.ts +36 -0
- package/src/__tests__/mocks.ts +473 -0
- package/src/__tests__/restAgent.test.ts +58 -0
- package/src/__tests__/shared/vcHandlerLocalAgentLogic.ts +160 -0
- package/src/agent/CredentialProviderJsonld.ts +281 -0
- package/src/agent/index.ts +1 -0
- package/src/contexts/X25519KeyAgreementKey2019.json +26 -0
- package/src/contexts/bbs-bls-signature-2020-v1.json +129 -0
- package/src/contexts/citizenship-v1.json +54 -0
- package/src/contexts/did_v0.11.json +64 -0
- package/src/contexts/ed25519-signature-2018-v1.json +91 -0
- package/src/contexts/ed25519-signature-2020-v1.json +77 -0
- package/src/contexts/eip712.json +93 -0
- package/src/contexts/json-web-signature-2020-v1.json +71 -0
- package/src/contexts/kyc-v1.json +8 -0
- package/src/contexts/lds-ecdsa-secp256k1-recovery2020-0.0.json +21 -0
- package/src/contexts/odrl.json +199 -0
- package/src/contexts/profile-v1.json +8 -0
- package/src/contexts/socialmedia-v1.json +7 -0
- package/src/contexts/transmute_v1.json +21 -0
- package/src/contexts/vc-revocation-list-2020-v1.json +46 -0
- package/src/contexts/vc-status-list-2021-v1.json +48 -0
- package/src/contexts/veramo.io_contexts_profile_v1.json +8 -0
- package/src/contexts/w3id.org_security_suites_ed25519-2018_v1.json +63 -0
- package/src/contexts/w3id.org_security_suites_secp256k1recovery-2020_v2.json +87 -0
- package/src/contexts/w3id.org_security_suites_x25519-2019_v1.json +26 -0
- package/src/contexts/w3id.org_security_v1.json +50 -0
- package/src/contexts/w3id.org_security_v2.json +63 -0
- package/src/contexts/w3id.org_security_v3-unstable.json +722 -0
- package/src/contexts/www.w3.org_2018_credentials_v1.json +237 -0
- package/src/contexts/www.w3.org_ns_credentials_v2.json +331 -0
- package/src/contexts/www.w3.org_ns_did_v1.json +58 -0
- package/src/enums.ts +28 -0
- package/src/index.ts +12 -0
- package/src/ld-context-loader.ts +32 -0
- package/src/ld-credential-module.ts +281 -0
- package/src/ld-default-contexts.ts +49 -0
- package/src/ld-document-loader.ts +156 -0
- package/src/ld-suite-loader.ts +83 -0
- package/src/ld-suites.ts +41 -0
- package/src/modules.d.ts +13 -0
- package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +100 -0
- package/src/suites/Ed25519Signature2018.ts +109 -0
- package/src/suites/Ed25519Signature2020.ts +93 -0
- package/src/suites/index.ts +3 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { TKeyType, IKey, CredentialPayload, PresentationPayload, DIDDocument as DIDDocument$2, VerifiableCredential, VerifiablePresentation, IIdentifier } from '@veramo/core';
|
|
2
|
+
import { DIDDocument } from 'did-resolver/lib/resolver';
|
|
3
|
+
import { IVcdmIssuerAgentContext, IVcdmVerifierAgentContext, ContextDoc, IVcdmCredentialProvider, ICanIssueCredentialTypeArgs, ICanVerifyDocumentTypeArgs, ICreateVerifiableCredentialLDArgs, ICreateVerifiablePresentationLDArgs, IVerifyCredentialLDArgs, IVerifyPresentationLDArgs } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
4
|
+
import { VerifiableCredentialSP, VerifiablePresentationSP } from '@sphereon/ssi-sdk.core';
|
|
5
|
+
import { DIDDocument as DIDDocument$1 } from 'did-resolver';
|
|
6
|
+
import { IIssueCredentialStatusOpts } from '@sphereon/ssi-sdk.vc-status-list';
|
|
7
|
+
import { IVerifyResult, W3CVerifiablePresentation } from '@sphereon/ssi-types';
|
|
8
|
+
import { RecordLike, OrPromise } from '@veramo/utils';
|
|
9
|
+
import { AbstractPrivateKeyStore } from '@veramo/key-manager';
|
|
10
|
+
|
|
11
|
+
declare abstract class SphereonLdSignature {
|
|
12
|
+
abstract getSupportedVerificationType(): string | string[];
|
|
13
|
+
abstract getSupportedProofType(): string;
|
|
14
|
+
abstract getSupportedKeyType(): TKeyType;
|
|
15
|
+
abstract getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
16
|
+
abstract getContext(): string;
|
|
17
|
+
abstract getSuiteForVerification(context: IVcdmVerifierAgentContext): any;
|
|
18
|
+
abstract preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void;
|
|
19
|
+
abstract preSigningCredModification(credential: CredentialPayload): void;
|
|
20
|
+
abstract preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
21
|
+
preSigningPresModification(presentation: PresentationPayload): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class SphereonEd25519Signature2018 extends SphereonLdSignature {
|
|
25
|
+
constructor();
|
|
26
|
+
getSupportedVerificationType(): string;
|
|
27
|
+
getSupportedProofType(): string;
|
|
28
|
+
getSupportedKeyType(): TKeyType;
|
|
29
|
+
getContext(): string;
|
|
30
|
+
getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
31
|
+
preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
32
|
+
getSuiteForVerification(): any;
|
|
33
|
+
preSigningCredModification(): void;
|
|
34
|
+
preDidResolutionModification(didUrl: string, didDoc: DIDDocument$1): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class SphereonEd25519Signature2020 extends SphereonLdSignature {
|
|
38
|
+
constructor();
|
|
39
|
+
getSupportedVerificationType(): string[];
|
|
40
|
+
getSupportedProofType(): string;
|
|
41
|
+
getSupportedKeyType(): TKeyType;
|
|
42
|
+
getContext(): string;
|
|
43
|
+
getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
44
|
+
preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
45
|
+
getSuiteForVerification(): any;
|
|
46
|
+
preSigningCredModification(): void;
|
|
47
|
+
preDidResolutionModification(): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class SphereonEcdsaSecp256k1RecoverySignature2020 extends SphereonLdSignature {
|
|
51
|
+
getSupportedVerificationType(): string;
|
|
52
|
+
getSupportedProofType(): string;
|
|
53
|
+
getSupportedKeyType(): TKeyType;
|
|
54
|
+
getSuiteForSigning(key: IKey, did: string, verifiableMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
55
|
+
getSuiteForVerification(): any;
|
|
56
|
+
preVerificationCredModification(): void;
|
|
57
|
+
preSigningCredModification(credential: CredentialPayload): void;
|
|
58
|
+
preDidResolutionModification(didUrl: string, didDoc: DIDDocument$2): void;
|
|
59
|
+
getContext(): string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The LdContextLoader is initialized with a List of Map<string, ContextDoc | Promise<ContextDoc>>
|
|
64
|
+
* that it unifies into a single Map to provide to the documentLoader within
|
|
65
|
+
* the w3c credential module.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare class LdContextLoader {
|
|
69
|
+
private readonly contexts;
|
|
70
|
+
constructor(options: {
|
|
71
|
+
contextsPaths: RecordLike<OrPromise<ContextDoc>>[];
|
|
72
|
+
});
|
|
73
|
+
has(url: string): boolean;
|
|
74
|
+
get(url: string): Promise<ContextDoc>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
|
|
79
|
+
*/
|
|
80
|
+
declare class LdSuiteLoader {
|
|
81
|
+
constructor(options: {
|
|
82
|
+
ldSignatureSuites: SphereonLdSignature[];
|
|
83
|
+
});
|
|
84
|
+
private signatureMap;
|
|
85
|
+
getSignatureSuiteForKeyType(keyType: TKeyType, verificationType?: string): SphereonLdSignature[];
|
|
86
|
+
getAllSignatureSuites(): SphereonLdSignature[];
|
|
87
|
+
getAllSignatureSuiteTypes(): string[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare const ProofPurpose$1: any;
|
|
91
|
+
declare class LdCredentialModule {
|
|
92
|
+
/**
|
|
93
|
+
* TODO: General Implementation Notes
|
|
94
|
+
* - (SOLVED) EcdsaSecp256k1Signature2019 (Signature) and EcdsaSecp256k1VerificationKey2019 (Key)
|
|
95
|
+
* are not useable right now, since they are not able to work with blockChainId and ECRecover.
|
|
96
|
+
* - DID Fragment Resolution.
|
|
97
|
+
* - Key Manager and Verification Methods: Veramo currently implements no link between those.
|
|
98
|
+
*/
|
|
99
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
100
|
+
private ldDocumentLoader;
|
|
101
|
+
constructor(options: {
|
|
102
|
+
ldContextLoader: LdContextLoader;
|
|
103
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
104
|
+
documentLoader?: {
|
|
105
|
+
localResolution?: boolean;
|
|
106
|
+
uniresolverResolution?: boolean;
|
|
107
|
+
resolverResolution?: boolean;
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
issueLDVerifiableCredential(args: {
|
|
111
|
+
credential: CredentialPayload;
|
|
112
|
+
issuerDid: string;
|
|
113
|
+
key: IKey;
|
|
114
|
+
verificationMethodId: string;
|
|
115
|
+
purpose: typeof ProofPurpose$1;
|
|
116
|
+
credentialStatusOpts?: IIssueCredentialStatusOpts;
|
|
117
|
+
}, context: IVcdmIssuerAgentContext): Promise<VerifiableCredentialSP>;
|
|
118
|
+
signLDVerifiablePresentation(presentation: PresentationPayload, holderDid: string, key: IKey, verificationMethodId: string, challenge: string | undefined, domain: string | undefined, purpose: typeof ProofPurpose$1 | undefined, context: IVcdmIssuerAgentContext): Promise<VerifiablePresentationSP>;
|
|
119
|
+
verifyCredential(credential: VerifiableCredentialSP, context: IVcdmVerifierAgentContext, fetchRemoteContexts?: boolean, purpose?: typeof ProofPurpose$1, checkStatus?: Function): Promise<IVerifyResult>;
|
|
120
|
+
private getAllVerificationSuites;
|
|
121
|
+
verifyPresentation(presentation: VerifiablePresentationSP | W3CVerifiablePresentation, challenge: string | undefined, domain: string | undefined, context: IVcdmVerifierAgentContext, fetchRemoteContexts?: boolean, presentationPurpose?: typeof ProofPurpose$1, checkStatus?: Function): Promise<IVerifyResult>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Provides a hardcoded map of common context definitions
|
|
126
|
+
*/
|
|
127
|
+
declare const LdDefaultContexts: Map<string, any>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
|
|
131
|
+
*/
|
|
132
|
+
declare class LdDocumentLoader {
|
|
133
|
+
private readonly ldContextLoader;
|
|
134
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
135
|
+
private readonly localResolution?;
|
|
136
|
+
private readonly uniresolverResolution?;
|
|
137
|
+
private readonly resolverResolution?;
|
|
138
|
+
constructor(options: {
|
|
139
|
+
ldContextLoader: LdContextLoader;
|
|
140
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
141
|
+
documentLoader?: {
|
|
142
|
+
localResolution?: boolean;
|
|
143
|
+
uniresolverResolution?: boolean;
|
|
144
|
+
resolverResolution?: boolean;
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
getLoader(context: IVcdmVerifierAgentContext, { attemptToFetchContexts, verifiableData, }: {
|
|
148
|
+
attemptToFetchContexts: boolean;
|
|
149
|
+
verifiableData: VerifiableCredential | VerifiableCredentialSP | VerifiablePresentation | VerifiablePresentationSP | CredentialPayload | PresentationPayload;
|
|
150
|
+
}): any;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* {@inheritDoc IVcLocalIssuerJsonLd}
|
|
155
|
+
*/
|
|
156
|
+
declare class CredentialProviderJsonld implements IVcdmCredentialProvider {
|
|
157
|
+
private ldCredentialModule;
|
|
158
|
+
private keyStore?;
|
|
159
|
+
constructor(options: {
|
|
160
|
+
contextMaps?: RecordLike<OrPromise<ContextDoc>>[];
|
|
161
|
+
suites?: SphereonLdSignature[];
|
|
162
|
+
keyStore?: AbstractPrivateKeyStore;
|
|
163
|
+
documentLoader?: {
|
|
164
|
+
localResolution?: boolean;
|
|
165
|
+
uniresolverResolution?: boolean;
|
|
166
|
+
resolverResolution?: boolean;
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.matchKeyForType} */
|
|
170
|
+
matchKeyForType(key: IKey): boolean;
|
|
171
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.getTypeProofFormat} */
|
|
172
|
+
getTypeProofFormat(): string;
|
|
173
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canIssueCredentialType} */
|
|
174
|
+
canIssueCredentialType(args: ICanIssueCredentialTypeArgs): boolean;
|
|
175
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canVerifyDocumentType */
|
|
176
|
+
canVerifyDocumentType(args: ICanVerifyDocumentTypeArgs): boolean;
|
|
177
|
+
/** {@inheritDoc ICredentialIssuerLDLocal.createVerifiableCredential} */
|
|
178
|
+
createVerifiableCredential(args: ICreateVerifiableCredentialLDArgs, context: IVcdmIssuerAgentContext): Promise<VerifiableCredentialSP>;
|
|
179
|
+
getSigningKey(identifier: IIdentifier, keyRef?: string): Promise<{
|
|
180
|
+
managedKey: IKey | undefined;
|
|
181
|
+
verificationMethod: string | undefined;
|
|
182
|
+
}>;
|
|
183
|
+
/** {@inheritdoc ICredentialIssuerLD.createVerifiablePresentationLD} */
|
|
184
|
+
createVerifiablePresentation(args: ICreateVerifiablePresentationLDArgs, context: IVcdmIssuerAgentContext): Promise<VerifiablePresentationSP>;
|
|
185
|
+
/** {@inheritdoc ICredentialHandlerLDLocal.verifyCredential} */
|
|
186
|
+
verifyCredential(args: IVerifyCredentialLDArgs, context: IVcdmVerifierAgentContext): Promise<IVerifyResult>;
|
|
187
|
+
/** {@inheritdoc ICredentialHandlerLDLocal.verifyPresentation} */
|
|
188
|
+
verifyPresentation(args: IVerifyPresentationLDArgs, context: IVcdmVerifierAgentContext): Promise<IVerifyResult>;
|
|
189
|
+
private findSigningKeyWithId;
|
|
190
|
+
/**
|
|
191
|
+
* Returns true if the key is supported by any of the installed LD Signature suites
|
|
192
|
+
* @param k - the key to match
|
|
193
|
+
*
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
matchKeyForLDSuite(k: IKey): boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare const ProofPurpose: any;
|
|
200
|
+
declare const ControllerProofPurpose: any;
|
|
201
|
+
declare const AssertionProofPurpose: any;
|
|
202
|
+
declare const AuthenticationProofPurpose: any;
|
|
203
|
+
/**
|
|
204
|
+
* Plugin method map interface
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
declare enum MethodNames {
|
|
208
|
+
createVerifiableCredential = "createVerifiableCredential",
|
|
209
|
+
createVerifiablePresentation = "createVerifiablePresentation",
|
|
210
|
+
verifyCredential = "verifyCredential",
|
|
211
|
+
verifyPresentation = "verifyPresentation"
|
|
212
|
+
}
|
|
213
|
+
type IBindingOverrides = Map<string, MethodNames>;
|
|
214
|
+
declare enum events {
|
|
215
|
+
CREDENTIAL_ISSUED = "credentialIssued",
|
|
216
|
+
CREDENTIAL_VERIFIED = "credentialVerified",
|
|
217
|
+
PRESENTATION_VERIFIED = "presentationVerified",
|
|
218
|
+
PRESENTATION_VERIFY_FAILED = "presentationVerificationFailed",
|
|
219
|
+
CREDENTIAL_VERIFY_FAILED = "credentialVerificationFailed"
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export { AssertionProofPurpose, AuthenticationProofPurpose, ControllerProofPurpose, CredentialProviderJsonld, type IBindingOverrides, LdContextLoader, LdCredentialModule, LdDefaultContexts, LdDocumentLoader, LdSuiteLoader, MethodNames, ProofPurpose, SphereonEcdsaSecp256k1RecoverySignature2020, SphereonEd25519Signature2018, SphereonEd25519Signature2020, SphereonLdSignature, events };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { TKeyType, IKey, CredentialPayload, PresentationPayload, DIDDocument as DIDDocument$2, VerifiableCredential, VerifiablePresentation, IIdentifier } from '@veramo/core';
|
|
2
|
+
import { DIDDocument } from 'did-resolver/lib/resolver';
|
|
3
|
+
import { IVcdmIssuerAgentContext, IVcdmVerifierAgentContext, ContextDoc, IVcdmCredentialProvider, ICanIssueCredentialTypeArgs, ICanVerifyDocumentTypeArgs, ICreateVerifiableCredentialLDArgs, ICreateVerifiablePresentationLDArgs, IVerifyCredentialLDArgs, IVerifyPresentationLDArgs } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
4
|
+
import { VerifiableCredentialSP, VerifiablePresentationSP } from '@sphereon/ssi-sdk.core';
|
|
5
|
+
import { DIDDocument as DIDDocument$1 } from 'did-resolver';
|
|
6
|
+
import { IIssueCredentialStatusOpts } from '@sphereon/ssi-sdk.vc-status-list';
|
|
7
|
+
import { IVerifyResult, W3CVerifiablePresentation } from '@sphereon/ssi-types';
|
|
8
|
+
import { RecordLike, OrPromise } from '@veramo/utils';
|
|
9
|
+
import { AbstractPrivateKeyStore } from '@veramo/key-manager';
|
|
10
|
+
|
|
11
|
+
declare abstract class SphereonLdSignature {
|
|
12
|
+
abstract getSupportedVerificationType(): string | string[];
|
|
13
|
+
abstract getSupportedProofType(): string;
|
|
14
|
+
abstract getSupportedKeyType(): TKeyType;
|
|
15
|
+
abstract getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
16
|
+
abstract getContext(): string;
|
|
17
|
+
abstract getSuiteForVerification(context: IVcdmVerifierAgentContext): any;
|
|
18
|
+
abstract preDidResolutionModification(didUrl: string, didDoc: DIDDocument): void;
|
|
19
|
+
abstract preSigningCredModification(credential: CredentialPayload): void;
|
|
20
|
+
abstract preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
21
|
+
preSigningPresModification(presentation: PresentationPayload): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class SphereonEd25519Signature2018 extends SphereonLdSignature {
|
|
25
|
+
constructor();
|
|
26
|
+
getSupportedVerificationType(): string;
|
|
27
|
+
getSupportedProofType(): string;
|
|
28
|
+
getSupportedKeyType(): TKeyType;
|
|
29
|
+
getContext(): string;
|
|
30
|
+
getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
31
|
+
preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
32
|
+
getSuiteForVerification(): any;
|
|
33
|
+
preSigningCredModification(): void;
|
|
34
|
+
preDidResolutionModification(didUrl: string, didDoc: DIDDocument$1): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class SphereonEd25519Signature2020 extends SphereonLdSignature {
|
|
38
|
+
constructor();
|
|
39
|
+
getSupportedVerificationType(): string[];
|
|
40
|
+
getSupportedProofType(): string;
|
|
41
|
+
getSupportedKeyType(): TKeyType;
|
|
42
|
+
getContext(): string;
|
|
43
|
+
getSuiteForSigning(key: IKey, issuerDid: string, verificationMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
44
|
+
preVerificationCredModification(credential: VerifiableCredentialSP): void;
|
|
45
|
+
getSuiteForVerification(): any;
|
|
46
|
+
preSigningCredModification(): void;
|
|
47
|
+
preDidResolutionModification(): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare class SphereonEcdsaSecp256k1RecoverySignature2020 extends SphereonLdSignature {
|
|
51
|
+
getSupportedVerificationType(): string;
|
|
52
|
+
getSupportedProofType(): string;
|
|
53
|
+
getSupportedKeyType(): TKeyType;
|
|
54
|
+
getSuiteForSigning(key: IKey, did: string, verifiableMethodId: string, context: IVcdmIssuerAgentContext): any;
|
|
55
|
+
getSuiteForVerification(): any;
|
|
56
|
+
preVerificationCredModification(): void;
|
|
57
|
+
preSigningCredModification(credential: CredentialPayload): void;
|
|
58
|
+
preDidResolutionModification(didUrl: string, didDoc: DIDDocument$2): void;
|
|
59
|
+
getContext(): string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The LdContextLoader is initialized with a List of Map<string, ContextDoc | Promise<ContextDoc>>
|
|
64
|
+
* that it unifies into a single Map to provide to the documentLoader within
|
|
65
|
+
* the w3c credential module.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
declare class LdContextLoader {
|
|
69
|
+
private readonly contexts;
|
|
70
|
+
constructor(options: {
|
|
71
|
+
contextsPaths: RecordLike<OrPromise<ContextDoc>>[];
|
|
72
|
+
});
|
|
73
|
+
has(url: string): boolean;
|
|
74
|
+
get(url: string): Promise<ContextDoc>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
|
|
79
|
+
*/
|
|
80
|
+
declare class LdSuiteLoader {
|
|
81
|
+
constructor(options: {
|
|
82
|
+
ldSignatureSuites: SphereonLdSignature[];
|
|
83
|
+
});
|
|
84
|
+
private signatureMap;
|
|
85
|
+
getSignatureSuiteForKeyType(keyType: TKeyType, verificationType?: string): SphereonLdSignature[];
|
|
86
|
+
getAllSignatureSuites(): SphereonLdSignature[];
|
|
87
|
+
getAllSignatureSuiteTypes(): string[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare const ProofPurpose$1: any;
|
|
91
|
+
declare class LdCredentialModule {
|
|
92
|
+
/**
|
|
93
|
+
* TODO: General Implementation Notes
|
|
94
|
+
* - (SOLVED) EcdsaSecp256k1Signature2019 (Signature) and EcdsaSecp256k1VerificationKey2019 (Key)
|
|
95
|
+
* are not useable right now, since they are not able to work with blockChainId and ECRecover.
|
|
96
|
+
* - DID Fragment Resolution.
|
|
97
|
+
* - Key Manager and Verification Methods: Veramo currently implements no link between those.
|
|
98
|
+
*/
|
|
99
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
100
|
+
private ldDocumentLoader;
|
|
101
|
+
constructor(options: {
|
|
102
|
+
ldContextLoader: LdContextLoader;
|
|
103
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
104
|
+
documentLoader?: {
|
|
105
|
+
localResolution?: boolean;
|
|
106
|
+
uniresolverResolution?: boolean;
|
|
107
|
+
resolverResolution?: boolean;
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
issueLDVerifiableCredential(args: {
|
|
111
|
+
credential: CredentialPayload;
|
|
112
|
+
issuerDid: string;
|
|
113
|
+
key: IKey;
|
|
114
|
+
verificationMethodId: string;
|
|
115
|
+
purpose: typeof ProofPurpose$1;
|
|
116
|
+
credentialStatusOpts?: IIssueCredentialStatusOpts;
|
|
117
|
+
}, context: IVcdmIssuerAgentContext): Promise<VerifiableCredentialSP>;
|
|
118
|
+
signLDVerifiablePresentation(presentation: PresentationPayload, holderDid: string, key: IKey, verificationMethodId: string, challenge: string | undefined, domain: string | undefined, purpose: typeof ProofPurpose$1 | undefined, context: IVcdmIssuerAgentContext): Promise<VerifiablePresentationSP>;
|
|
119
|
+
verifyCredential(credential: VerifiableCredentialSP, context: IVcdmVerifierAgentContext, fetchRemoteContexts?: boolean, purpose?: typeof ProofPurpose$1, checkStatus?: Function): Promise<IVerifyResult>;
|
|
120
|
+
private getAllVerificationSuites;
|
|
121
|
+
verifyPresentation(presentation: VerifiablePresentationSP | W3CVerifiablePresentation, challenge: string | undefined, domain: string | undefined, context: IVcdmVerifierAgentContext, fetchRemoteContexts?: boolean, presentationPurpose?: typeof ProofPurpose$1, checkStatus?: Function): Promise<IVerifyResult>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Provides a hardcoded map of common context definitions
|
|
126
|
+
*/
|
|
127
|
+
declare const LdDefaultContexts: Map<string, any>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
|
|
131
|
+
*/
|
|
132
|
+
declare class LdDocumentLoader {
|
|
133
|
+
private readonly ldContextLoader;
|
|
134
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
135
|
+
private readonly localResolution?;
|
|
136
|
+
private readonly uniresolverResolution?;
|
|
137
|
+
private readonly resolverResolution?;
|
|
138
|
+
constructor(options: {
|
|
139
|
+
ldContextLoader: LdContextLoader;
|
|
140
|
+
ldSuiteLoader: LdSuiteLoader;
|
|
141
|
+
documentLoader?: {
|
|
142
|
+
localResolution?: boolean;
|
|
143
|
+
uniresolverResolution?: boolean;
|
|
144
|
+
resolverResolution?: boolean;
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
getLoader(context: IVcdmVerifierAgentContext, { attemptToFetchContexts, verifiableData, }: {
|
|
148
|
+
attemptToFetchContexts: boolean;
|
|
149
|
+
verifiableData: VerifiableCredential | VerifiableCredentialSP | VerifiablePresentation | VerifiablePresentationSP | CredentialPayload | PresentationPayload;
|
|
150
|
+
}): any;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* {@inheritDoc IVcLocalIssuerJsonLd}
|
|
155
|
+
*/
|
|
156
|
+
declare class CredentialProviderJsonld implements IVcdmCredentialProvider {
|
|
157
|
+
private ldCredentialModule;
|
|
158
|
+
private keyStore?;
|
|
159
|
+
constructor(options: {
|
|
160
|
+
contextMaps?: RecordLike<OrPromise<ContextDoc>>[];
|
|
161
|
+
suites?: SphereonLdSignature[];
|
|
162
|
+
keyStore?: AbstractPrivateKeyStore;
|
|
163
|
+
documentLoader?: {
|
|
164
|
+
localResolution?: boolean;
|
|
165
|
+
uniresolverResolution?: boolean;
|
|
166
|
+
resolverResolution?: boolean;
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.matchKeyForType} */
|
|
170
|
+
matchKeyForType(key: IKey): boolean;
|
|
171
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.getTypeProofFormat} */
|
|
172
|
+
getTypeProofFormat(): string;
|
|
173
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canIssueCredentialType} */
|
|
174
|
+
canIssueCredentialType(args: ICanIssueCredentialTypeArgs): boolean;
|
|
175
|
+
/** {@inheritdoc @veramo/credential-w3c#AbstractCredentialProvider.canVerifyDocumentType */
|
|
176
|
+
canVerifyDocumentType(args: ICanVerifyDocumentTypeArgs): boolean;
|
|
177
|
+
/** {@inheritDoc ICredentialIssuerLDLocal.createVerifiableCredential} */
|
|
178
|
+
createVerifiableCredential(args: ICreateVerifiableCredentialLDArgs, context: IVcdmIssuerAgentContext): Promise<VerifiableCredentialSP>;
|
|
179
|
+
getSigningKey(identifier: IIdentifier, keyRef?: string): Promise<{
|
|
180
|
+
managedKey: IKey | undefined;
|
|
181
|
+
verificationMethod: string | undefined;
|
|
182
|
+
}>;
|
|
183
|
+
/** {@inheritdoc ICredentialIssuerLD.createVerifiablePresentationLD} */
|
|
184
|
+
createVerifiablePresentation(args: ICreateVerifiablePresentationLDArgs, context: IVcdmIssuerAgentContext): Promise<VerifiablePresentationSP>;
|
|
185
|
+
/** {@inheritdoc ICredentialHandlerLDLocal.verifyCredential} */
|
|
186
|
+
verifyCredential(args: IVerifyCredentialLDArgs, context: IVcdmVerifierAgentContext): Promise<IVerifyResult>;
|
|
187
|
+
/** {@inheritdoc ICredentialHandlerLDLocal.verifyPresentation} */
|
|
188
|
+
verifyPresentation(args: IVerifyPresentationLDArgs, context: IVcdmVerifierAgentContext): Promise<IVerifyResult>;
|
|
189
|
+
private findSigningKeyWithId;
|
|
190
|
+
/**
|
|
191
|
+
* Returns true if the key is supported by any of the installed LD Signature suites
|
|
192
|
+
* @param k - the key to match
|
|
193
|
+
*
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
matchKeyForLDSuite(k: IKey): boolean;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
declare const ProofPurpose: any;
|
|
200
|
+
declare const ControllerProofPurpose: any;
|
|
201
|
+
declare const AssertionProofPurpose: any;
|
|
202
|
+
declare const AuthenticationProofPurpose: any;
|
|
203
|
+
/**
|
|
204
|
+
* Plugin method map interface
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
declare enum MethodNames {
|
|
208
|
+
createVerifiableCredential = "createVerifiableCredential",
|
|
209
|
+
createVerifiablePresentation = "createVerifiablePresentation",
|
|
210
|
+
verifyCredential = "verifyCredential",
|
|
211
|
+
verifyPresentation = "verifyPresentation"
|
|
212
|
+
}
|
|
213
|
+
type IBindingOverrides = Map<string, MethodNames>;
|
|
214
|
+
declare enum events {
|
|
215
|
+
CREDENTIAL_ISSUED = "credentialIssued",
|
|
216
|
+
CREDENTIAL_VERIFIED = "credentialVerified",
|
|
217
|
+
PRESENTATION_VERIFIED = "presentationVerified",
|
|
218
|
+
PRESENTATION_VERIFY_FAILED = "presentationVerificationFailed",
|
|
219
|
+
CREDENTIAL_VERIFY_FAILED = "credentialVerificationFailed"
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export { AssertionProofPurpose, AuthenticationProofPurpose, ControllerProofPurpose, CredentialProviderJsonld, type IBindingOverrides, LdContextLoader, LdCredentialModule, LdDefaultContexts, LdDocumentLoader, LdSuiteLoader, MethodNames, ProofPurpose, SphereonEcdsaSecp256k1RecoverySignature2020, SphereonEd25519Signature2018, SphereonEd25519Signature2020, SphereonLdSignature, events };
|