@sphereon/ssi-sdk.oid4vci-holder 0.33.1-next.3 → 0.33.1-next.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3143 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +786 -0
- package/dist/index.d.ts +785 -11
- package/dist/index.js +3112 -31
- package/dist/index.js.map +1 -1
- package/package.json +44 -33
- package/src/agent/OID4VCIHolder.ts +8 -5
- package/dist/agent/OID4VCIHolder.d.ts +0 -59
- package/dist/agent/OID4VCIHolder.d.ts.map +0 -1
- package/dist/agent/OID4VCIHolder.js +0 -884
- package/dist/agent/OID4VCIHolder.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/link-handler/index.d.ts +0 -31
- package/dist/link-handler/index.d.ts.map +0 -1
- package/dist/link-handler/index.js +0 -65
- package/dist/link-handler/index.js.map +0 -1
- package/dist/listeners/headlessStateNavListener.d.ts +0 -3
- package/dist/listeners/headlessStateNavListener.d.ts.map +0 -1
- package/dist/listeners/headlessStateNavListener.js +0 -45
- package/dist/listeners/headlessStateNavListener.js.map +0 -1
- package/dist/localization/Localization.d.ts +0 -9
- package/dist/localization/Localization.d.ts.map +0 -1
- package/dist/localization/Localization.js +0 -46
- package/dist/localization/Localization.js.map +0 -1
- package/dist/localization/translations/en.json +0 -19
- package/dist/localization/translations/nl.json +0 -18
- package/dist/machines/firstPartyMachine.d.ts +0 -15
- package/dist/machines/firstPartyMachine.d.ts.map +0 -1
- package/dist/machines/firstPartyMachine.js +0 -222
- package/dist/machines/firstPartyMachine.js.map +0 -1
- package/dist/machines/oid4vciMachine.d.ts +0 -7
- package/dist/machines/oid4vciMachine.d.ts.map +0 -1
- package/dist/machines/oid4vciMachine.js +0 -727
- package/dist/machines/oid4vciMachine.js.map +0 -1
- package/dist/mappers/OIDC4VCIBrandingMapper.d.ts +0 -16
- package/dist/mappers/OIDC4VCIBrandingMapper.d.ts.map +0 -1
- package/dist/mappers/OIDC4VCIBrandingMapper.js +0 -201
- package/dist/mappers/OIDC4VCIBrandingMapper.js.map +0 -1
- package/dist/services/FirstPartyMachineServices.d.ts +0 -9
- package/dist/services/FirstPartyMachineServices.d.ts.map +0 -1
- package/dist/services/FirstPartyMachineServices.js +0 -53
- package/dist/services/FirstPartyMachineServices.js.map +0 -1
- package/dist/services/OID4VCIHolderService.d.ts +0 -28
- package/dist/services/OID4VCIHolderService.d.ts.map +0 -1
- package/dist/services/OID4VCIHolderService.js +0 -524
- package/dist/services/OID4VCIHolderService.js.map +0 -1
- package/dist/types/FirstPartyMachine.d.ts +0 -112
- package/dist/types/FirstPartyMachine.d.ts.map +0 -1
- package/dist/types/FirstPartyMachine.js +0 -30
- package/dist/types/FirstPartyMachine.js.map +0 -1
- package/dist/types/IOID4VCIHolder.d.ts +0 -558
- package/dist/types/IOID4VCIHolder.d.ts.map +0 -1
- package/dist/types/IOID4VCIHolder.js +0 -114
- package/dist/types/IOID4VCIHolder.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,786 @@
|
|
|
1
|
+
import { AuthorizationChallengeCodeResponse, EndpointMetadataResult, CredentialOfferRequestWithBaseUrl, AuthzFlowType, AuthorizationRequestOpts, AuthorizationServerClientOpts, CredentialConfigurationSupported, ExperimentalSubjectIssuance, CredentialResponse, AuthorizationResponse, CredentialsSupportedDisplay, IssuerCredentialSubject, MetadataDisplay, NotificationRequest, Jwt } from '@sphereon/oid4vci-common';
|
|
2
|
+
import { IIdentifierResolution, ManagedIdentifierMethod, ManagedIdentifierOptsOrResult, ManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
3
|
+
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
4
|
+
import { IIdentifier, IPluginMethodMap, IAgentContext, ICredentialVerifier, ICredentialIssuer, IDIDManager, IResolver, IKeyManager, TKeyType, VerificationPolicies, TAgent, IAgentPlugin } from '@veramo/core';
|
|
5
|
+
import { OpenID4VCIClientState, OpenID4VCIClient } from '@sphereon/oid4vci-client';
|
|
6
|
+
import { DynamicRegistrationClientMetadata } from '@sphereon/oid4vc-common';
|
|
7
|
+
import { SupportedDidMethodEnum, CreateOrGetIdentifierOpts, IdentifierProviderOpts } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
8
|
+
import { IContactManager } from '@sphereon/ssi-sdk.contact-manager';
|
|
9
|
+
import { UniqueDigitalCredential, ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
|
|
10
|
+
import { Party, DidAuthConfig, IIssuerLocaleBranding, IBasicIssuerLocaleBranding, IBasicCredentialLocaleBranding, Identity, DigitalCredential, IBasicCredentialClaim } from '@sphereon/ssi-sdk.data-store';
|
|
11
|
+
import { IIssuanceBranding } from '@sphereon/ssi-sdk.issuance-branding';
|
|
12
|
+
import { ImDLMdoc } from '@sphereon/ssi-sdk.mdl-mdoc';
|
|
13
|
+
import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
|
|
14
|
+
import { ICredentialValidation, SchemaValidation } from '@sphereon/ssi-sdk.credential-validation';
|
|
15
|
+
import { IDidAuthSiopOpAuthenticator, CreateConfigResult } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth';
|
|
16
|
+
import { IVerifiableCredential, W3CVerifiableCredential, WrappedVerifiableCredential, WrappedVerifiablePresentation, JoseSignatureAlgorithm, JoseSignatureAlgorithmString, HasherSync, SdJwtTypeDisplayMetadata, SdJwtClaimMetadata, OriginalVerifiableCredential } from '@sphereon/ssi-types';
|
|
17
|
+
import { Interpreter, State, StatesConfig, StateMachine, BaseActionObject, ServiceMap, ResolveTypegenMeta, TypegenDisabled } from 'xstate';
|
|
18
|
+
import { RPRegistrationMetadataPayload, PresentationDefinitionWithLocation } from '@sphereon/did-auth-siop';
|
|
19
|
+
import { LinkHandlerAdapter, DefaultLinkPriorities } from '@sphereon/ssi-sdk.core';
|
|
20
|
+
import { IMachineStatePersistence, SerializableState } from '@sphereon/ssi-sdk.xstate-machine-persistence';
|
|
21
|
+
|
|
22
|
+
declare enum FirstPartyMachineStateTypes {
|
|
23
|
+
sendAuthorizationChallengeRequest = "sendAuthorizationChallengeRequest",
|
|
24
|
+
sendAuthorizationResponse = "sendAuthorizationResponse",
|
|
25
|
+
selectCredentials = "selectCredentials",
|
|
26
|
+
createConfig = "createConfig",
|
|
27
|
+
getSiopRequest = "getSiopRequest",
|
|
28
|
+
error = "error",
|
|
29
|
+
done = "done",
|
|
30
|
+
aborted = "aborted",
|
|
31
|
+
declined = "declined"
|
|
32
|
+
}
|
|
33
|
+
declare enum FirstPartyMachineServices {
|
|
34
|
+
sendAuthorizationChallengeRequest = "sendAuthorizationChallengeRequest",
|
|
35
|
+
sendAuthorizationResponse = "sendAuthorizationResponse",
|
|
36
|
+
createConfig = "createConfig",
|
|
37
|
+
getSiopRequest = "getSiopRequest"
|
|
38
|
+
}
|
|
39
|
+
type FirstPartyMachineStates = Record<FirstPartyMachineStateTypes, {}>;
|
|
40
|
+
type FirstPartyMachineContext = {
|
|
41
|
+
openID4VCIClientState: OpenID4VCIClientState;
|
|
42
|
+
selectedCredentials: Array<UniqueDigitalCredential>;
|
|
43
|
+
contact: Party;
|
|
44
|
+
authSession?: string;
|
|
45
|
+
presentationUri?: string;
|
|
46
|
+
identifier?: IIdentifier;
|
|
47
|
+
didAuthConfig?: Omit<DidAuthConfig, 'identifier'>;
|
|
48
|
+
authorizationRequestData?: SiopV2AuthorizationRequestData;
|
|
49
|
+
presentationDuringIssuanceSession?: string;
|
|
50
|
+
authorizationCodeResponse?: AuthorizationChallengeCodeResponse;
|
|
51
|
+
error?: ErrorDetails;
|
|
52
|
+
};
|
|
53
|
+
declare enum FirstPartyMachineEvents {
|
|
54
|
+
NEXT = "NEXT",
|
|
55
|
+
PREVIOUS = "PREVIOUS",
|
|
56
|
+
DECLINE = "DECLINE",
|
|
57
|
+
SET_SELECTED_CREDENTIALS = "SET_SELECTED_CREDENTIALS"
|
|
58
|
+
}
|
|
59
|
+
type FirstPartyNextEvent = {
|
|
60
|
+
type: FirstPartyMachineEvents.NEXT;
|
|
61
|
+
};
|
|
62
|
+
type FirstPartyPreviousEvent = {
|
|
63
|
+
type: FirstPartyMachineEvents.PREVIOUS;
|
|
64
|
+
};
|
|
65
|
+
type FirstPartyDeclineEvent = {
|
|
66
|
+
type: FirstPartyMachineEvents.DECLINE;
|
|
67
|
+
};
|
|
68
|
+
type FirstPartySelectCredentialsEvent = {
|
|
69
|
+
type: FirstPartyMachineEvents.SET_SELECTED_CREDENTIALS;
|
|
70
|
+
data: Array<UniqueDigitalCredential>;
|
|
71
|
+
};
|
|
72
|
+
type FirstPartyMachineEventTypes = FirstPartyNextEvent | FirstPartyPreviousEvent | FirstPartyDeclineEvent | FirstPartySelectCredentialsEvent;
|
|
73
|
+
type FirstPartyMachineStatesConfig = StatesConfig<FirstPartyMachineContext, {
|
|
74
|
+
states: FirstPartyMachineStates;
|
|
75
|
+
}, FirstPartyMachineEventTypes, any>;
|
|
76
|
+
type CreateFirstPartyMachineOpts = {
|
|
77
|
+
openID4VCIClientState: OpenID4VCIClientState;
|
|
78
|
+
contact: Party;
|
|
79
|
+
agentContext: RequiredContext;
|
|
80
|
+
machineId?: string;
|
|
81
|
+
};
|
|
82
|
+
type FirstPartyStateMachine = StateMachine<FirstPartyMachineContext, any, FirstPartyMachineEventTypes, {
|
|
83
|
+
value: any;
|
|
84
|
+
context: FirstPartyMachineContext;
|
|
85
|
+
}, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, FirstPartyMachineEventTypes, BaseActionObject, ServiceMap>>;
|
|
86
|
+
type FirstPartyMachineInterpreter = Interpreter<FirstPartyMachineContext, any, FirstPartyMachineEventTypes, {
|
|
87
|
+
value: any;
|
|
88
|
+
context: FirstPartyMachineContext;
|
|
89
|
+
}, any>;
|
|
90
|
+
type FirstPartyMachineStateNavigationListener = (firstPartyMachine: FirstPartyMachineInterpreter, state: FirstPartyMachineState, navigation?: any) => Promise<void>;
|
|
91
|
+
type InstanceFirstPartyMachineOpts = {
|
|
92
|
+
services?: any;
|
|
93
|
+
guards?: any;
|
|
94
|
+
subscription?: () => void;
|
|
95
|
+
requireCustomNavigationHook?: boolean;
|
|
96
|
+
stateNavigationListener?: FirstPartyMachineStateNavigationListener;
|
|
97
|
+
} & CreateFirstPartyMachineOpts;
|
|
98
|
+
type FirstPartyMachineState = State<FirstPartyMachineContext, FirstPartyMachineEventTypes, any, {
|
|
99
|
+
value: any;
|
|
100
|
+
context: FirstPartyMachineContext;
|
|
101
|
+
}, any>;
|
|
102
|
+
type FirstPartyMachineServiceDefinitions = Record<keyof typeof FirstPartyMachineServices, (...args: Array<any>) => any>;
|
|
103
|
+
type SendAuthorizationChallengeRequestArgs = Pick<FirstPartyMachineContext, 'openID4VCIClientState' | 'authSession' | 'presentationDuringIssuanceSession'>;
|
|
104
|
+
type SendAuthorizationResponseArgs = Pick<FirstPartyMachineContext, 'authSession' | 'presentationUri' | 'didAuthConfig' | 'authorizationRequestData' | 'selectedCredentials'>;
|
|
105
|
+
type CreateConfigArgs = Pick<FirstPartyMachineContext, 'presentationUri' | 'identifier'>;
|
|
106
|
+
type GetSiopRequestArgs = Pick<FirstPartyMachineContext, 'didAuthConfig' | 'presentationUri'>;
|
|
107
|
+
type SiopV2AuthorizationRequestData = {
|
|
108
|
+
correlationId: string;
|
|
109
|
+
registrationMetadataPayload: RPRegistrationMetadataPayload;
|
|
110
|
+
issuer?: string;
|
|
111
|
+
name?: string;
|
|
112
|
+
uri?: URL;
|
|
113
|
+
clientIdScheme?: string;
|
|
114
|
+
clientId?: string;
|
|
115
|
+
entityId?: string;
|
|
116
|
+
presentationDefinitions?: PresentationDefinitionWithLocation[];
|
|
117
|
+
};
|
|
118
|
+
type FirstPartyMachineNavigationArgs = {
|
|
119
|
+
firstPartyMachine: FirstPartyMachineInterpreter;
|
|
120
|
+
state: FirstPartyMachineState;
|
|
121
|
+
navigation: any;
|
|
122
|
+
onNext?: () => void;
|
|
123
|
+
onBack?: () => void;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
interface IOID4VCIHolder extends IPluginMethodMap {
|
|
127
|
+
oid4vciHolderGetIssuerMetadata(args: GetIssuerMetadataArgs, context: RequiredContext): Promise<EndpointMetadataResult>;
|
|
128
|
+
oid4vciHolderGetMachineInterpreter(args: GetMachineArgs, context: RequiredContext): Promise<OID4VCIMachine>;
|
|
129
|
+
oid4vciHolderStart(args: PrepareStartArgs, context: RequiredContext): Promise<StartResult>;
|
|
130
|
+
oid4vciHolderCreateCredentialsToSelectFrom(args: CreateCredentialsToSelectFromArgs, context: RequiredContext): Promise<Array<CredentialToSelectFromResult>>;
|
|
131
|
+
oid4vciHolderGetContact(args: GetContactArgs, context: RequiredContext): Promise<Party | undefined>;
|
|
132
|
+
oid4vciHolderGetCredentials(args: GetCredentialsArgs, context: RequiredContext): Promise<Array<MappedCredentialToAccept>>;
|
|
133
|
+
oid4vciHolderGetCredential(args: GetCredentialArgs, context: RequiredContext): Promise<MappedCredentialToAccept>;
|
|
134
|
+
oid4vciHolderAddContactIdentity(args: AddContactIdentityArgs, context: RequiredContext): Promise<Identity>;
|
|
135
|
+
oid4vciHolderAssertValidCredentials(args: AssertValidCredentialsArgs, context: RequiredContext): Promise<Array<VerificationResult>>;
|
|
136
|
+
oid4vciHolderGetIssuerBranding(args: GetIssuerBrandingArgs, context: RequiredContext): Promise<Array<IIssuerLocaleBranding | IBasicIssuerLocaleBranding>>;
|
|
137
|
+
oid4vciHolderStoreIssuerBranding(args: StoreIssuerBrandingArgs, context: RequiredContext): Promise<void>;
|
|
138
|
+
oid4vciHolderStoreCredentialBranding(args: StoreCredentialBrandingArgs, context: RequiredContext): Promise<void>;
|
|
139
|
+
oid4vciHolderStoreCredentials(args: StoreCredentialsArgs, context: RequiredContext): Promise<void>;
|
|
140
|
+
}
|
|
141
|
+
type OID4VCIHolderOptions = {
|
|
142
|
+
onContactIdentityCreated?: (args: OnContactIdentityCreatedArgs) => Promise<void>;
|
|
143
|
+
onCredentialStored?: (args: OnCredentialStoredArgs) => Promise<void>;
|
|
144
|
+
onIdentifierCreated?: (args: OnIdentifierCreatedArgs) => Promise<void>;
|
|
145
|
+
onVerifyEBSICredentialIssuer?: (args: VerifyEBSICredentialIssuerArgs) => Promise<VerifyEBSICredentialIssuerResult>;
|
|
146
|
+
vcFormatPreferences?: Array<string>;
|
|
147
|
+
jsonldCryptographicSuitePreferences?: Array<string>;
|
|
148
|
+
defaultAuthorizationRequestOptions?: AuthorizationRequestOpts;
|
|
149
|
+
didMethodPreferences?: Array<SupportedDidMethodEnum>;
|
|
150
|
+
jwtCryptographicSuitePreferences?: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
|
|
151
|
+
hasher?: HasherSync;
|
|
152
|
+
};
|
|
153
|
+
type OnContactIdentityCreatedArgs = {
|
|
154
|
+
contactId: string;
|
|
155
|
+
identity: Identity;
|
|
156
|
+
};
|
|
157
|
+
type GetIssuerMetadataArgs = {
|
|
158
|
+
issuer: string;
|
|
159
|
+
errorOnNotFound?: boolean;
|
|
160
|
+
};
|
|
161
|
+
type OnCredentialStoredArgs = {
|
|
162
|
+
credential: DigitalCredential;
|
|
163
|
+
vcHash: string;
|
|
164
|
+
};
|
|
165
|
+
type OnIdentifierCreatedArgs = {
|
|
166
|
+
identifier: ManagedIdentifierResult;
|
|
167
|
+
};
|
|
168
|
+
type GetMachineArgs = {
|
|
169
|
+
requestData: RequestData;
|
|
170
|
+
trustAnchors?: Array<string>;
|
|
171
|
+
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
172
|
+
clientOpts?: AuthorizationServerClientOpts;
|
|
173
|
+
didMethodPreferences?: Array<SupportedDidMethodEnum>;
|
|
174
|
+
issuanceOpt?: Partial<IssuanceOpts>;
|
|
175
|
+
stateNavigationListener?: OID4VCIMachineStateNavigationListener;
|
|
176
|
+
firstPartyStateNavigationListener?: FirstPartyMachineStateNavigationListener;
|
|
177
|
+
};
|
|
178
|
+
type PrepareStartArgs = Pick<OID4VCIMachineContext, 'requestData' | 'authorizationRequestOpts' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
|
|
179
|
+
type CreateCredentialsToSelectFromArgs = Pick<OID4VCIMachineContext, 'credentialsSupported' | 'credentialBranding' | 'selectedCredentials' | 'locale' | 'openID4VCIClientState'>;
|
|
180
|
+
type GetContactArgs = Pick<OID4VCIMachineContext, 'serverMetadata'>;
|
|
181
|
+
type GetCredentialsArgs = Pick<OID4VCIMachineContext, 'verificationCode' | 'openID4VCIClientState' | 'selectedCredentials' | 'didMethodPreferences' | 'issuanceOpt' | 'accessTokenOpts'>;
|
|
182
|
+
type AddContactIdentityArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'contact'>;
|
|
183
|
+
type GetIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'serverMetadata' | 'contact'>;
|
|
184
|
+
type StoreIssuerBrandingArgs = Pick<OID4VCIMachineContext, 'issuerBranding' | 'contact'>;
|
|
185
|
+
type AssertValidCredentialsArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'issuanceOpt'>;
|
|
186
|
+
type StoreCredentialBrandingArgs = Pick<OID4VCIMachineContext, 'serverMetadata' | 'credentialBranding' | 'selectedCredentials' | 'credentialsToAccept'>;
|
|
187
|
+
type StoreCredentialsArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'serverMetadata' | 'credentialsSupported' | 'openID4VCIClientState' | 'selectedCredentials' | 'issuanceOpt'>;
|
|
188
|
+
type SendNotificationArgs = Pick<OID4VCIMachineContext, 'credentialsToAccept' | 'serverMetadata' | 'credentialsSupported' | 'openID4VCIClientState'> & {
|
|
189
|
+
notificationRequest?: NotificationRequest;
|
|
190
|
+
stored: boolean;
|
|
191
|
+
};
|
|
192
|
+
type GetFederationTrustArgs = Pick<OID4VCIMachineContext, 'requestData' | 'trustAnchors' | 'serverMetadata'>;
|
|
193
|
+
type StartFirstPartApplicationMachine = Pick<OID4VCIMachineContext, 'openID4VCIClientState' | 'contact'> & {
|
|
194
|
+
stateNavigationListener?: FirstPartyMachineStateNavigationListener;
|
|
195
|
+
};
|
|
196
|
+
declare enum OID4VCIHolderEvent {
|
|
197
|
+
CONTACT_IDENTITY_CREATED = "contact_identity_created",
|
|
198
|
+
CREDENTIAL_STORED = "credential_stored",
|
|
199
|
+
IDENTIFIER_CREATED = "identifier_created"
|
|
200
|
+
}
|
|
201
|
+
type RequestData = {
|
|
202
|
+
credentialOffer?: CredentialOfferRequestWithBaseUrl;
|
|
203
|
+
code?: string;
|
|
204
|
+
uri: string;
|
|
205
|
+
existingClientState?: string;
|
|
206
|
+
createAuthorizationRequestURL?: boolean;
|
|
207
|
+
flowType?: AuthzFlowType;
|
|
208
|
+
[x: string]: any;
|
|
209
|
+
};
|
|
210
|
+
declare enum SupportedLanguage {
|
|
211
|
+
ENGLISH = "en",
|
|
212
|
+
DUTCH = "nl"
|
|
213
|
+
}
|
|
214
|
+
type VerifyCredentialToAcceptArgs = {
|
|
215
|
+
mappedCredential: MappedCredentialToAccept;
|
|
216
|
+
onVerifyEBSICredentialIssuer?: (args: VerifyEBSICredentialIssuerArgs) => Promise<VerifyEBSICredentialIssuerResult>;
|
|
217
|
+
hasher?: HasherSync;
|
|
218
|
+
schemaValidation?: SchemaValidation;
|
|
219
|
+
context: RequiredContext;
|
|
220
|
+
};
|
|
221
|
+
type MappedCredentialToAccept = ExperimentalSubjectIssuance & {
|
|
222
|
+
correlationId: string;
|
|
223
|
+
types: string[];
|
|
224
|
+
credentialToAccept: CredentialToAccept;
|
|
225
|
+
uniformVerifiableCredential: IVerifiableCredential;
|
|
226
|
+
rawVerifiableCredential: W3CVerifiableCredential;
|
|
227
|
+
};
|
|
228
|
+
type OID4VCIMachineContext = {
|
|
229
|
+
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
230
|
+
accessTokenOpts?: AccessTokenOpts;
|
|
231
|
+
didMethodPreferences?: Array<SupportedDidMethodEnum>;
|
|
232
|
+
issuanceOpt?: IssuanceOpts;
|
|
233
|
+
trustAnchors: Array<string>;
|
|
234
|
+
requestData?: RequestData;
|
|
235
|
+
locale?: string;
|
|
236
|
+
authorizationCodeURL?: string;
|
|
237
|
+
issuerBranding?: Array<IIssuerLocaleBranding | IBasicIssuerLocaleBranding>;
|
|
238
|
+
credentialBranding?: Record<string, Array<IBasicCredentialLocaleBranding>>;
|
|
239
|
+
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
240
|
+
serverMetadata?: EndpointMetadataResult;
|
|
241
|
+
openID4VCIClientState?: OpenID4VCIClientState;
|
|
242
|
+
credentialToSelectFrom: Array<CredentialToSelectFromResult>;
|
|
243
|
+
contactAlias: string;
|
|
244
|
+
contact?: Party;
|
|
245
|
+
selectedCredentials: Array<string>;
|
|
246
|
+
credentialsToAccept: Array<MappedCredentialToAccept>;
|
|
247
|
+
verificationCode?: string;
|
|
248
|
+
hasContactConsent: boolean;
|
|
249
|
+
trustedAnchors?: Array<string>;
|
|
250
|
+
error?: ErrorDetails;
|
|
251
|
+
};
|
|
252
|
+
declare enum OID4VCIMachineStates {
|
|
253
|
+
start = "start",
|
|
254
|
+
createCredentialsToSelectFrom = "createCredentialsToSelectFrom",
|
|
255
|
+
getContact = "getContact",
|
|
256
|
+
transitionFromSetup = "transitionFromSetup",
|
|
257
|
+
getFederationTrust = "getFederationTrust",
|
|
258
|
+
reviewContact = "reviewContact",
|
|
259
|
+
addContact = "addContact",
|
|
260
|
+
getIssuerBranding = "getIssuerBranding",
|
|
261
|
+
storeIssuerBranding = "storeIssuerBranding",
|
|
262
|
+
addIssuerBrandingAfterIdentity = "addIssuerBrandingAfterIdentity",
|
|
263
|
+
transitionFromContactSetup = "transitionFromContactSetup",
|
|
264
|
+
startFirstPartApplicationFlow = "startFirstPartApplicationFlow",
|
|
265
|
+
selectCredentials = "selectCredentials",
|
|
266
|
+
transitionFromSelectingCredentials = "transitionFromSelectingCredentials",
|
|
267
|
+
verifyPin = "verifyPin",
|
|
268
|
+
initiateAuthorizationRequest = "initiateAuthorizationRequest",
|
|
269
|
+
waitForAuthorizationResponse = "waitForAuthorizationResponse",
|
|
270
|
+
getCredentials = "getCredentials",
|
|
271
|
+
transitionFromWalletInput = "transitionFromWalletInput",
|
|
272
|
+
addContactIdentity = "addContactIdentity",
|
|
273
|
+
reviewCredentials = "reviewCredentials",
|
|
274
|
+
verifyCredentials = "verifyCredentials",
|
|
275
|
+
storeCredentialBranding = "storeCredentialBranding",
|
|
276
|
+
storeCredentials = "storeCredentials",
|
|
277
|
+
handleError = "handleError",
|
|
278
|
+
aborted = "aborted",
|
|
279
|
+
declined = "declined",
|
|
280
|
+
error = "error",
|
|
281
|
+
done = "done"
|
|
282
|
+
}
|
|
283
|
+
declare enum OID4VCIMachineAddContactStates {
|
|
284
|
+
idle = "idle",
|
|
285
|
+
next = "next"
|
|
286
|
+
}
|
|
287
|
+
declare enum OID4VCIMachineVerifyPinStates {
|
|
288
|
+
idle = "idle",
|
|
289
|
+
next = "next"
|
|
290
|
+
}
|
|
291
|
+
type OID4VCIMachineInterpreter = Interpreter<OID4VCIMachineContext, any, OID4VCIMachineEventTypes, {
|
|
292
|
+
value: any;
|
|
293
|
+
context: OID4VCIMachineContext;
|
|
294
|
+
}, any>;
|
|
295
|
+
type OID4VCIMachineState = State<OID4VCIMachineContext, OID4VCIMachineEventTypes, any, {
|
|
296
|
+
value: any;
|
|
297
|
+
context: OID4VCIMachineContext;
|
|
298
|
+
}, any>;
|
|
299
|
+
type OID4VCIStateMachine = StateMachine<OID4VCIMachineContext, any, OID4VCIMachineEventTypes, {
|
|
300
|
+
value: any;
|
|
301
|
+
context: OID4VCIMachineContext;
|
|
302
|
+
}, BaseActionObject, ServiceMap, ResolveTypegenMeta<TypegenDisabled, OID4VCIMachineEventTypes, BaseActionObject, ServiceMap>>;
|
|
303
|
+
type CreateOID4VCIMachineOpts = {
|
|
304
|
+
requestData: RequestData;
|
|
305
|
+
machineName?: string;
|
|
306
|
+
locale?: string;
|
|
307
|
+
trustAnchors?: Array<string>;
|
|
308
|
+
stateDefinition?: OID4VCIMachineState;
|
|
309
|
+
didMethodPreferences?: Array<SupportedDidMethodEnum>;
|
|
310
|
+
accessTokenOpts?: AccessTokenOpts;
|
|
311
|
+
issuanceOpt?: IssuanceOpts;
|
|
312
|
+
};
|
|
313
|
+
type OID4VCIMachineStateNavigationListener = (oid4vciMachine: OID4VCIMachineInterpreter, state: OID4VCIMachineState, navigation?: any) => Promise<void>;
|
|
314
|
+
type OID4VCIMachineInstanceOpts = {
|
|
315
|
+
services?: any;
|
|
316
|
+
guards?: any;
|
|
317
|
+
subscription?: () => void;
|
|
318
|
+
requireCustomNavigationHook?: boolean;
|
|
319
|
+
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
320
|
+
didMethodPreferences?: Array<SupportedDidMethodEnum>;
|
|
321
|
+
issuanceOpt?: IssuanceOpts;
|
|
322
|
+
stateNavigationListener?: OID4VCIMachineStateNavigationListener;
|
|
323
|
+
firstPartyStateNavigationListener?: FirstPartyMachineStateNavigationListener;
|
|
324
|
+
} & CreateOID4VCIMachineOpts;
|
|
325
|
+
type OID4VCIProviderProps = {
|
|
326
|
+
children?: any;
|
|
327
|
+
customOID4VCIInstance?: OID4VCIMachineInterpreter;
|
|
328
|
+
};
|
|
329
|
+
type OID4VCIContext = {
|
|
330
|
+
oid4vciInstance?: OID4VCIMachineInterpreter;
|
|
331
|
+
};
|
|
332
|
+
type OID4VCIMachineNavigationArgs = {
|
|
333
|
+
oid4vciMachine: OID4VCIMachineInterpreter;
|
|
334
|
+
state: OID4VCIMachineState;
|
|
335
|
+
navigation: any;
|
|
336
|
+
onNext?: () => void;
|
|
337
|
+
onBack?: () => void;
|
|
338
|
+
};
|
|
339
|
+
declare enum OID4VCIMachineEvents {
|
|
340
|
+
NEXT = "NEXT",
|
|
341
|
+
PREVIOUS = "PREVIOUS",
|
|
342
|
+
DECLINE = "DECLINE",
|
|
343
|
+
CREATE_CONTACT = "CREATE_CONTACT",
|
|
344
|
+
SET_VERIFICATION_CODE = "SET_VERIFICATION_CODE",
|
|
345
|
+
SET_CONTACT_ALIAS = "SET_CONTACT_ALIAS",
|
|
346
|
+
SET_CONTACT_CONSENT = "SET_CONTACT_CONSENT",
|
|
347
|
+
SET_SELECTED_CREDENTIALS = "SET_SELECTED_CREDENTIALS",
|
|
348
|
+
SET_AUTHORIZATION_CODE_URL = "SET_AUTHORIZATION_CODE_URL",
|
|
349
|
+
INVOKED_AUTHORIZATION_CODE_REQUEST = "INVOKED_AUTHORIZATION_CODE_REQUEST",
|
|
350
|
+
PROVIDE_AUTHORIZATION_CODE_RESPONSE = "PROVIDE_AUTHORIZATION_CODE_RESPONSE"
|
|
351
|
+
}
|
|
352
|
+
declare enum OID4VCIMachineGuards {
|
|
353
|
+
hasContactGuard = "oid4vciHasContactGuard",
|
|
354
|
+
hasNoContactGuard = "oid4vciHasNoContactGuard",
|
|
355
|
+
credentialsToSelectRequiredGuard = "oid4vciCredentialsToSelectRequiredGuard",
|
|
356
|
+
requirePinGuard = "oid4vciRequirePinGuard",
|
|
357
|
+
requireAuthorizationGuard = "oid4vciRequireAuthorizationGuard",
|
|
358
|
+
noAuthorizationGuard = "oid4vciNoAuthorizationGuard",
|
|
359
|
+
hasAuthorizationResponse = "oid4vciHasAuthorizationResponse",
|
|
360
|
+
hasNoContactIdentityGuard = "oid4vciHasNoContactIdentityGuard",
|
|
361
|
+
verificationCodeGuard = "oid4vciVerificationCodeGuard",
|
|
362
|
+
createContactGuard = "oid4vciCreateContactGuard",
|
|
363
|
+
hasSelectedCredentialsGuard = "oid4vciHasSelectedCredentialsGuard",
|
|
364
|
+
isOIDFOriginGuard = "oid4vciIsOIDFOriginGuard",
|
|
365
|
+
contactHasLowTrustGuard = "oid4vciContactHasLowTrustGuard",
|
|
366
|
+
isFirstPartyApplication = "oid4vciIsFirstPartyApplication"
|
|
367
|
+
}
|
|
368
|
+
declare enum OID4VCIMachineServices {
|
|
369
|
+
start = "start",
|
|
370
|
+
getContact = "getContact",
|
|
371
|
+
getFederationTrust = "getFederationTrust",
|
|
372
|
+
addContactIdentity = "addContactIdentity",
|
|
373
|
+
createCredentialsToSelectFrom = "createCredentialsToSelectFrom",
|
|
374
|
+
getIssuerBranding = "getIssuerBranding",
|
|
375
|
+
storeIssuerBranding = "storeIssuerBranding",
|
|
376
|
+
getCredentials = "getCredentials",
|
|
377
|
+
assertValidCredentials = "assertValidCredentials",
|
|
378
|
+
storeCredentialBranding = "storeCredentialBranding",
|
|
379
|
+
sendNotification = "sendNotification",
|
|
380
|
+
storeCredentials = "storeCredentials",
|
|
381
|
+
startFirstPartApplicationFlow = "startFirstPartApplicationFlow"
|
|
382
|
+
}
|
|
383
|
+
type OID4VCIMachineServiceDefinitions = Record<keyof typeof OID4VCIMachineServices, (...args: Array<any>) => any>;
|
|
384
|
+
type NextEvent = {
|
|
385
|
+
type: OID4VCIMachineEvents.NEXT;
|
|
386
|
+
};
|
|
387
|
+
type PreviousEvent = {
|
|
388
|
+
type: OID4VCIMachineEvents.PREVIOUS;
|
|
389
|
+
};
|
|
390
|
+
type DeclineEvent = {
|
|
391
|
+
type: OID4VCIMachineEvents.DECLINE;
|
|
392
|
+
};
|
|
393
|
+
type CreateContactEvent = {
|
|
394
|
+
type: OID4VCIMachineEvents.CREATE_CONTACT;
|
|
395
|
+
data: Party;
|
|
396
|
+
};
|
|
397
|
+
type SelectCredentialsEvent = {
|
|
398
|
+
type: OID4VCIMachineEvents.SET_SELECTED_CREDENTIALS;
|
|
399
|
+
data: Array<string>;
|
|
400
|
+
};
|
|
401
|
+
type VerificationCodeEvent = {
|
|
402
|
+
type: OID4VCIMachineEvents.SET_VERIFICATION_CODE;
|
|
403
|
+
data: string;
|
|
404
|
+
};
|
|
405
|
+
type ContactConsentEvent = {
|
|
406
|
+
type: OID4VCIMachineEvents.SET_CONTACT_CONSENT;
|
|
407
|
+
data: boolean;
|
|
408
|
+
};
|
|
409
|
+
type ContactAliasEvent = {
|
|
410
|
+
type: OID4VCIMachineEvents.SET_CONTACT_ALIAS;
|
|
411
|
+
data: string;
|
|
412
|
+
};
|
|
413
|
+
type SetAuthorizationCodeURLEvent = {
|
|
414
|
+
type: OID4VCIMachineEvents.SET_AUTHORIZATION_CODE_URL;
|
|
415
|
+
data: string;
|
|
416
|
+
};
|
|
417
|
+
type InvokeAuthorizationRequestEvent = {
|
|
418
|
+
type: OID4VCIMachineEvents.INVOKED_AUTHORIZATION_CODE_REQUEST;
|
|
419
|
+
data: string;
|
|
420
|
+
};
|
|
421
|
+
type AuthorizationResponseEvent = {
|
|
422
|
+
type: OID4VCIMachineEvents.PROVIDE_AUTHORIZATION_CODE_RESPONSE;
|
|
423
|
+
data: string | AuthorizationResponse;
|
|
424
|
+
};
|
|
425
|
+
type OID4VCIMachineEventTypes = NextEvent | PreviousEvent | DeclineEvent | CreateContactEvent | SelectCredentialsEvent | VerificationCodeEvent | ContactConsentEvent | ContactAliasEvent | SetAuthorizationCodeURLEvent | InvokeAuthorizationRequestEvent | AuthorizationResponseEvent;
|
|
426
|
+
type ErrorDetails = {
|
|
427
|
+
title: string;
|
|
428
|
+
message: string;
|
|
429
|
+
detailsTitle?: string;
|
|
430
|
+
detailsMessage?: string;
|
|
431
|
+
stack?: string;
|
|
432
|
+
};
|
|
433
|
+
declare enum RequestType {
|
|
434
|
+
OPENID_INITIATE_ISSUANCE = "openid-initiate-issuance",
|
|
435
|
+
OPENID_CREDENTIAL_OFFER = "openid-credential-offer",
|
|
436
|
+
URL = "URL"
|
|
437
|
+
}
|
|
438
|
+
type CredentialToSelectFromResult = ExperimentalSubjectIssuance & {
|
|
439
|
+
id: string;
|
|
440
|
+
credentialId: string;
|
|
441
|
+
credentialTypes: Array<string>;
|
|
442
|
+
credentialAlias: string;
|
|
443
|
+
isSelected: boolean;
|
|
444
|
+
};
|
|
445
|
+
type OID4VCIMachine = {
|
|
446
|
+
interpreter: OID4VCIMachineInterpreter;
|
|
447
|
+
};
|
|
448
|
+
type StartResult = {
|
|
449
|
+
authorizationCodeURL?: string;
|
|
450
|
+
credentialBranding?: Record<string, Array<IBasicCredentialLocaleBranding>>;
|
|
451
|
+
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
452
|
+
serverMetadata: EndpointMetadataResult;
|
|
453
|
+
oid4vciClientState: OpenID4VCIClientState;
|
|
454
|
+
};
|
|
455
|
+
type SelectAppLocaleBrandingArgs = {
|
|
456
|
+
locale?: string;
|
|
457
|
+
localeBranding?: Array<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding>;
|
|
458
|
+
};
|
|
459
|
+
type IssuanceOpts = CredentialConfigurationSupported & {
|
|
460
|
+
credentialConfigurationId?: string;
|
|
461
|
+
supportedBindingMethods: ManagedIdentifierMethod[];
|
|
462
|
+
supportedPreferredDidMethod?: SupportedDidMethodEnum;
|
|
463
|
+
schemaValidation?: SchemaValidation;
|
|
464
|
+
identifier?: ManagedIdentifierOptsOrResult;
|
|
465
|
+
keyType?: TKeyType;
|
|
466
|
+
codecName?: string;
|
|
467
|
+
kms?: string;
|
|
468
|
+
};
|
|
469
|
+
type VerificationResult = {
|
|
470
|
+
result: boolean;
|
|
471
|
+
source: WrappedVerifiableCredential | WrappedVerifiablePresentation;
|
|
472
|
+
subResults: Array<VerificationSubResult>;
|
|
473
|
+
error?: string | undefined;
|
|
474
|
+
errorDetails?: string;
|
|
475
|
+
};
|
|
476
|
+
type VerificationSubResult = {
|
|
477
|
+
result: boolean;
|
|
478
|
+
error?: string;
|
|
479
|
+
errorDetails?: string;
|
|
480
|
+
};
|
|
481
|
+
type CredentialToAccept = {
|
|
482
|
+
id?: string;
|
|
483
|
+
types: string[];
|
|
484
|
+
issuanceOpt: IssuanceOpts;
|
|
485
|
+
credentialResponse: CredentialResponse;
|
|
486
|
+
};
|
|
487
|
+
type GetCredentialConfigsSupportedArgs = {
|
|
488
|
+
client: OpenID4VCIClient;
|
|
489
|
+
vcFormatPreferences: Array<string>;
|
|
490
|
+
format?: Array<string>;
|
|
491
|
+
types?: Array<Array<string>>;
|
|
492
|
+
configurationIds?: Array<string>;
|
|
493
|
+
};
|
|
1
494
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
495
|
+
* Please note that this method is restricting the results to one set of types or configurationId.
|
|
496
|
+
* It can potentially return multiple results mainly because of different formats.
|
|
497
|
+
*/
|
|
498
|
+
type GetCredentialConfigsSupportedBySingleTypeOrIdArgs = {
|
|
499
|
+
client: OpenID4VCIClient;
|
|
500
|
+
vcFormatPreferences: Array<string>;
|
|
501
|
+
format?: string[];
|
|
502
|
+
types?: string[];
|
|
503
|
+
configurationId?: string;
|
|
504
|
+
};
|
|
505
|
+
type GetCredentialBrandingArgs = {
|
|
506
|
+
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
507
|
+
context: RequiredContext;
|
|
508
|
+
};
|
|
509
|
+
type GetBasicIssuerLocaleBrandingArgs = {
|
|
510
|
+
display: MetadataDisplay[];
|
|
511
|
+
dynamicRegistrationClientMetadata?: DynamicRegistrationClientMetadataDisplay;
|
|
512
|
+
context: RequiredContext;
|
|
513
|
+
};
|
|
514
|
+
type GetPreferredCredentialFormatsArgs = {
|
|
515
|
+
credentials: Record<string, CredentialConfigurationSupported>;
|
|
516
|
+
vcFormatPreferences: Array<string>;
|
|
517
|
+
};
|
|
518
|
+
type MapCredentialToAcceptArgs = {
|
|
519
|
+
credentialToAccept: CredentialToAccept;
|
|
520
|
+
hasher?: HasherSync;
|
|
521
|
+
};
|
|
522
|
+
type GetDefaultIssuanceOptsArgs = {
|
|
523
|
+
credentialSupported: CredentialConfigurationSupported;
|
|
524
|
+
opts: DefaultIssuanceOpts;
|
|
525
|
+
context: RequiredContext;
|
|
526
|
+
};
|
|
527
|
+
type DefaultIssuanceOpts = {
|
|
528
|
+
client: OpenID4VCIClient;
|
|
529
|
+
};
|
|
530
|
+
type GetIdentifierArgs = {
|
|
531
|
+
issuanceOpt: IssuanceOpts;
|
|
532
|
+
context: RequiredContext;
|
|
533
|
+
};
|
|
534
|
+
type GetAuthenticationKeyArgs = {
|
|
535
|
+
identifier: ManagedIdentifierOptsOrResult;
|
|
536
|
+
offlineWhenNoDIDRegistered?: boolean;
|
|
537
|
+
noVerificationMethodFallback?: boolean;
|
|
538
|
+
context: IAgentContext<IResolver & IDIDManager & IKeyManager>;
|
|
539
|
+
};
|
|
540
|
+
type GetOrCreatePrimaryIdentifierArgs = {
|
|
541
|
+
context: RequiredContext;
|
|
542
|
+
opts?: CreateOrGetIdentifierOpts;
|
|
543
|
+
};
|
|
544
|
+
type CreateIdentifierArgs = {
|
|
545
|
+
context: RequiredContext;
|
|
546
|
+
opts?: CreateIdentifierOpts;
|
|
547
|
+
};
|
|
548
|
+
type CreateIdentifierOpts = {
|
|
549
|
+
method: SupportedDidMethodEnum;
|
|
550
|
+
createOpts?: CreateIdentifierCreateOpts;
|
|
551
|
+
};
|
|
552
|
+
type CreateIdentifierCreateOpts = {
|
|
553
|
+
kms?: string;
|
|
554
|
+
alias?: string;
|
|
555
|
+
options?: IdentifierProviderOpts;
|
|
556
|
+
};
|
|
557
|
+
type GetIssuanceOptsArgs = {
|
|
558
|
+
client: OpenID4VCIClient;
|
|
559
|
+
credentialsSupported: Record<string, CredentialConfigurationSupported>;
|
|
560
|
+
serverMetadata: EndpointMetadataResult;
|
|
561
|
+
context: RequiredContext;
|
|
562
|
+
didMethodPreferences: Array<SupportedDidMethodEnum>;
|
|
563
|
+
jwtCryptographicSuitePreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
|
|
564
|
+
jsonldCryptographicSuitePreferences: Array<string>;
|
|
565
|
+
forceIssuanceOpt?: IssuanceOpts;
|
|
566
|
+
};
|
|
567
|
+
type GetIssuanceDidMethodArgs = {
|
|
568
|
+
credentialSupported: CredentialConfigurationSupported;
|
|
569
|
+
client: OpenID4VCIClient;
|
|
570
|
+
didMethodPreferences: Array<SupportedDidMethodEnum>;
|
|
571
|
+
};
|
|
572
|
+
type GetIssuanceCryptoSuiteArgs = {
|
|
573
|
+
credentialSupported: CredentialConfigurationSupported;
|
|
574
|
+
client: OpenID4VCIClient;
|
|
575
|
+
jwtCryptographicSuitePreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>;
|
|
576
|
+
jsonldCryptographicSuitePreferences: Array<string>;
|
|
577
|
+
};
|
|
578
|
+
type GetCredentialArgs = {
|
|
579
|
+
pin?: string;
|
|
580
|
+
issuanceOpt: IssuanceOpts;
|
|
581
|
+
client: OpenID4VCIClient;
|
|
582
|
+
accessTokenOpts?: AccessTokenOpts;
|
|
583
|
+
};
|
|
584
|
+
type AccessTokenOpts = {
|
|
585
|
+
additionalRequestParams?: Record<string, any>;
|
|
586
|
+
clientOpts?: AuthorizationServerClientOpts;
|
|
587
|
+
};
|
|
588
|
+
declare enum IdentifierAliasEnum {
|
|
589
|
+
PRIMARY = "primary"
|
|
590
|
+
}
|
|
591
|
+
type CredentialVerificationError = {
|
|
592
|
+
error?: string;
|
|
593
|
+
errorDetails?: string;
|
|
594
|
+
};
|
|
595
|
+
type VerifyMdocArgs = {
|
|
596
|
+
credential: string;
|
|
597
|
+
};
|
|
598
|
+
type VerifySDJWTCredentialArgs = {
|
|
599
|
+
credential: string;
|
|
600
|
+
hasher?: HasherSync;
|
|
601
|
+
};
|
|
602
|
+
interface VerifyCredentialArgs {
|
|
603
|
+
credential: OriginalVerifiableCredential;
|
|
604
|
+
fetchRemoteContexts?: boolean;
|
|
605
|
+
policies?: VerificationPolicies;
|
|
606
|
+
[x: string]: any;
|
|
607
|
+
}
|
|
608
|
+
type IssuerType = 'RootTAO' | 'TAO' | 'TI' | 'Revoked or Undefined';
|
|
609
|
+
type VerifyEBSICredentialIssuerArgs = {
|
|
610
|
+
wrappedVc: WrappedVerifiableCredential;
|
|
611
|
+
issuerType?: IssuerType[];
|
|
612
|
+
};
|
|
613
|
+
type Attribute = {
|
|
614
|
+
hash: string;
|
|
615
|
+
body: string;
|
|
616
|
+
issuerType: IssuerType;
|
|
617
|
+
tao: string;
|
|
618
|
+
rootTao: string;
|
|
619
|
+
};
|
|
620
|
+
type VerifyEBSICredentialIssuerResult = {
|
|
621
|
+
did: string;
|
|
622
|
+
attributes: Attribute[];
|
|
623
|
+
};
|
|
624
|
+
type Oid4vciCredentialLocaleBrandingFromArgs = {
|
|
625
|
+
credentialDisplay: CredentialsSupportedDisplay;
|
|
626
|
+
};
|
|
627
|
+
type SdJwtCredentialLocaleBrandingFromArgs = {
|
|
628
|
+
credentialDisplay: SdJwtTypeDisplayMetadata;
|
|
629
|
+
};
|
|
630
|
+
type SdJwtGetCredentialBrandingFromArgs = {
|
|
631
|
+
credentialDisplay?: Array<SdJwtTypeDisplayMetadata>;
|
|
632
|
+
claimsMetadata?: Array<SdJwtClaimMetadata>;
|
|
633
|
+
};
|
|
634
|
+
type SdJwtCredentialClaimLocalesFromArgs = {
|
|
635
|
+
claimsMetadata: Array<SdJwtClaimMetadata>;
|
|
636
|
+
};
|
|
637
|
+
type IssuerLocaleBrandingFromArgs = {
|
|
638
|
+
issuerDisplay: MetadataDisplay;
|
|
639
|
+
dynamicRegistrationClientMetadata?: DynamicRegistrationClientMetadataDisplay;
|
|
640
|
+
};
|
|
641
|
+
type Oid4vciGetCredentialBrandingFromArgs = {
|
|
642
|
+
credentialDisplay?: Array<CredentialsSupportedDisplay>;
|
|
643
|
+
issuerCredentialSubject?: IssuerCredentialSubject;
|
|
644
|
+
};
|
|
645
|
+
type Oid4vciCredentialDisplayLocalesFromArgs = {
|
|
646
|
+
credentialDisplay: Array<CredentialsSupportedDisplay>;
|
|
647
|
+
};
|
|
648
|
+
type SdJwtCredentialDisplayLocalesFromArgs = {
|
|
649
|
+
credentialDisplay: Array<SdJwtTypeDisplayMetadata>;
|
|
650
|
+
};
|
|
651
|
+
type Oid4vciIssuerCredentialSubjectLocalesFromArgs = {
|
|
652
|
+
issuerCredentialSubject: IssuerCredentialSubject;
|
|
653
|
+
};
|
|
654
|
+
type Oid4vciCombineDisplayLocalesFromArgs = {
|
|
655
|
+
credentialDisplayLocales?: Map<string, CredentialsSupportedDisplay>;
|
|
656
|
+
issuerCredentialSubjectLocales?: Map<string, Array<IBasicCredentialClaim>>;
|
|
657
|
+
};
|
|
658
|
+
type SdJwtCombineDisplayLocalesFromArgs = {
|
|
659
|
+
credentialDisplayLocales?: Map<string, SdJwtTypeDisplayMetadata>;
|
|
660
|
+
claimsMetadata?: Map<string, Array<IBasicCredentialClaim>>;
|
|
661
|
+
};
|
|
662
|
+
type DynamicRegistrationClientMetadataDisplay = Pick<DynamicRegistrationClientMetadata, 'client_name' | 'client_uri' | 'contacts' | 'tos_uri' | 'policy_uri' | 'logo_uri'>;
|
|
663
|
+
type DidAgents = TAgent<IResolver & IDIDManager>;
|
|
664
|
+
type RequiredContext = IAgentContext<IIssuanceBranding & IContactManager & ICredentialValidation & ICredentialVerifier & ICredentialIssuer & ICredentialStore & IIdentifierResolution & IJwtService & IDIDManager & IResolver & IKeyManager & ISDJwtPlugin & ImDLMdoc & IDidAuthSiopOpAuthenticator>;
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* {@inheritDoc IOID4VCIHolder}
|
|
668
|
+
*/
|
|
669
|
+
declare const oid4vciHolderContextMethods: Array<string>;
|
|
670
|
+
declare function signCallback(identifier: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager & IDIDManager & IResolver & IIdentifierResolution & IJwtService>, nonce?: string): (jwt: Jwt, kid?: string) => Promise<string>;
|
|
671
|
+
declare class OID4VCIHolder implements IAgentPlugin {
|
|
672
|
+
private readonly hasher?;
|
|
673
|
+
readonly eventTypes: Array<OID4VCIHolderEvent>;
|
|
674
|
+
readonly methods: IOID4VCIHolder;
|
|
675
|
+
private readonly vcFormatPreferences;
|
|
676
|
+
private readonly jsonldCryptographicSuitePreferences;
|
|
677
|
+
private readonly didMethodPreferences;
|
|
678
|
+
private readonly jwtCryptographicSuitePreferences;
|
|
679
|
+
private static readonly DEFAULT_MOBILE_REDIRECT_URI;
|
|
680
|
+
private readonly defaultAuthorizationRequestOpts;
|
|
681
|
+
private readonly onContactIdentityCreated?;
|
|
682
|
+
private readonly onCredentialStored?;
|
|
683
|
+
private readonly onIdentifierCreated?;
|
|
684
|
+
private readonly onVerifyEBSICredentialIssuer?;
|
|
685
|
+
constructor(options?: OID4VCIHolderOptions);
|
|
686
|
+
onEvent(event: any, context: RequiredContext): Promise<void>;
|
|
687
|
+
/**
|
|
688
|
+
* FIXME: This method can only be used locally. Creating the interpreter should be local to where the agent is running
|
|
689
|
+
*/
|
|
690
|
+
private oid4vciHolderGetMachineInterpreter;
|
|
691
|
+
/**
|
|
692
|
+
* This method is run before the machine starts! So there is no concept of the state machine context or states yet
|
|
693
|
+
*
|
|
694
|
+
* The result of this method can be directly passed into the start method of the state machine
|
|
695
|
+
* @param args
|
|
696
|
+
* @param context
|
|
697
|
+
* @private
|
|
698
|
+
*/
|
|
699
|
+
private oid4vciHolderStart;
|
|
700
|
+
private oid4vciHolderCreateCredentialsToSelectFrom;
|
|
701
|
+
private oid4vciHolderGetContact;
|
|
702
|
+
private oid4vciHolderGetCredentials;
|
|
703
|
+
private oid4vciHolderGetCredential;
|
|
704
|
+
private oid4vciHolderAddContactIdentity;
|
|
705
|
+
private oid4vciHolderGetIssuerBranding;
|
|
706
|
+
private oid4vciHolderStoreIssuerBranding;
|
|
707
|
+
private oid4vciHolderAssertValidCredentials;
|
|
708
|
+
private oid4vciHolderStoreCredentialBranding;
|
|
709
|
+
private oid4vciHolderStoreCredentials;
|
|
710
|
+
private oid4vciHolderSendNotification;
|
|
711
|
+
private getFederationTrust;
|
|
712
|
+
private oid4vciHolderGetIssuerMetadata;
|
|
713
|
+
private determineSubjectCorrelation;
|
|
714
|
+
private idFromW3cCredentialSubject;
|
|
715
|
+
private getCredentialDefinition;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
declare const oid4vciGetCredentialBrandingFrom: (args: Oid4vciGetCredentialBrandingFromArgs) => Promise<Array<IBasicCredentialLocaleBranding>>;
|
|
719
|
+
declare const oid4vciCredentialDisplayLocalesFrom: (args: Oid4vciCredentialDisplayLocalesFromArgs) => Promise<Map<string, CredentialsSupportedDisplay>>;
|
|
720
|
+
declare const oid4vciIssuerCredentialSubjectLocalesFrom: (args: Oid4vciIssuerCredentialSubjectLocalesFromArgs) => Promise<Map<string, Array<IBasicCredentialClaim>>>;
|
|
721
|
+
declare const oid4vciCredentialLocaleBrandingFrom: (args: Oid4vciCredentialLocaleBrandingFromArgs) => Promise<IBasicCredentialLocaleBranding>;
|
|
722
|
+
declare const oid4vciCombineDisplayLocalesFrom: (args: Oid4vciCombineDisplayLocalesFromArgs) => Promise<Array<IBasicCredentialLocaleBranding>>;
|
|
723
|
+
declare const sdJwtGetCredentialBrandingFrom: (args: SdJwtGetCredentialBrandingFromArgs) => Promise<Array<IBasicCredentialLocaleBranding>>;
|
|
724
|
+
declare const sdJwtCredentialDisplayLocalesFrom: (args: SdJwtCredentialDisplayLocalesFromArgs) => Promise<Map<string, SdJwtTypeDisplayMetadata>>;
|
|
725
|
+
declare const sdJwtCredentialClaimLocalesFrom: (args: SdJwtCredentialClaimLocalesFromArgs) => Promise<Map<string, Array<IBasicCredentialClaim>>>;
|
|
726
|
+
declare const sdJwtCredentialLocaleBrandingFrom: (args: SdJwtCredentialLocaleBrandingFromArgs) => Promise<IBasicCredentialLocaleBranding>;
|
|
727
|
+
declare const sdJwtCombineDisplayLocalesFrom: (args: SdJwtCombineDisplayLocalesFromArgs) => Promise<Array<IBasicCredentialLocaleBranding>>;
|
|
728
|
+
declare const issuerLocaleBrandingFrom: (args: IssuerLocaleBrandingFromArgs) => Promise<IBasicIssuerLocaleBranding>;
|
|
729
|
+
|
|
730
|
+
declare const getCredentialBranding: (args: GetCredentialBrandingArgs) => Promise<Record<string, Array<IBasicCredentialLocaleBranding>>>;
|
|
731
|
+
declare const getBasicIssuerLocaleBranding: (args: GetBasicIssuerLocaleBrandingArgs) => Promise<Array<IBasicIssuerLocaleBranding>>;
|
|
732
|
+
declare const getCredentialConfigsBasedOnFormatPref: (args: GetPreferredCredentialFormatsArgs) => Promise<Record<string, CredentialConfigurationSupported>>;
|
|
733
|
+
declare const selectCredentialLocaleBranding: (args: SelectAppLocaleBrandingArgs) => Promise<IBasicCredentialLocaleBranding | IBasicIssuerLocaleBranding | undefined>;
|
|
734
|
+
declare const verifyCredentialToAccept: (args: VerifyCredentialToAcceptArgs) => Promise<VerificationResult>;
|
|
735
|
+
declare const mapCredentialToAccept: (args: MapCredentialToAcceptArgs) => Promise<MappedCredentialToAccept>;
|
|
736
|
+
declare const getIdentifierOpts: (args: GetIdentifierArgs) => Promise<ManagedIdentifierResult>;
|
|
737
|
+
declare const getCredentialConfigsSupportedMerged: (args: GetCredentialConfigsSupportedArgs) => Promise<Record<string, CredentialConfigurationSupported>>;
|
|
738
|
+
declare const getCredentialConfigsSupported: (args: GetCredentialConfigsSupportedArgs) => Promise<Array<Record<string, CredentialConfigurationSupported>>>;
|
|
739
|
+
/**
|
|
740
|
+
* Please note that this method only returns configs supported for a single set of credential types or a single config id.
|
|
741
|
+
* If an offer contains multiple formats/types in an array or multiple config ids, you will have to call this method for all of them
|
|
742
|
+
* @param args
|
|
743
|
+
*/
|
|
744
|
+
declare const getCredentialConfigsSupportedBySingleTypeOrId: (args: GetCredentialConfigsSupportedBySingleTypeOrIdArgs) => Promise<Record<string, CredentialConfigurationSupported>>;
|
|
745
|
+
declare const getIssuanceOpts: (args: GetIssuanceOptsArgs) => Promise<Array<IssuanceOpts>>;
|
|
746
|
+
declare const getIssuanceMethod: (opts: GetIssuanceDidMethodArgs) => Promise<{
|
|
747
|
+
methods: ManagedIdentifierMethod[];
|
|
748
|
+
didMethod?: SupportedDidMethodEnum;
|
|
749
|
+
}>;
|
|
750
|
+
declare const getIssuanceCryptoSuite: (opts: GetIssuanceCryptoSuiteArgs) => Promise<string>;
|
|
751
|
+
declare const startFirstPartApplicationMachine: (args: StartFirstPartApplicationMachine, context: RequiredContext) => Promise<AuthorizationChallengeCodeResponse | string>;
|
|
752
|
+
|
|
753
|
+
declare const sendAuthorizationChallengeRequest: (args: SendAuthorizationChallengeRequestArgs) => Promise<AuthorizationChallengeCodeResponse>;
|
|
754
|
+
declare const createConfig: (args: CreateConfigArgs, context: RequiredContext) => Promise<CreateConfigResult>;
|
|
755
|
+
declare const getSiopRequest: (args: GetSiopRequestArgs, context: RequiredContext) => Promise<SiopV2AuthorizationRequestData>;
|
|
756
|
+
declare const sendAuthorizationResponse: (args: SendAuthorizationResponseArgs, context: RequiredContext) => Promise<string>;
|
|
757
|
+
|
|
758
|
+
declare const OID4VCICallbackStateListener: (callbacks?: Map<OID4VCIMachineStates, (machine: OID4VCIMachineInterpreter, state: OID4VCIMachineState, opts?: any) => Promise<void>>) => (oid4vciMachine: OID4VCIMachineInterpreter, state: OID4VCIMachineState) => Promise<void>;
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* This handler only handles credential offer links (either by value or by reference)
|
|
762
|
+
*/
|
|
763
|
+
declare class OID4VCIHolderLinkHandler extends LinkHandlerAdapter {
|
|
764
|
+
private readonly context;
|
|
765
|
+
private readonly stateNavigationListener?;
|
|
766
|
+
private readonly firstPartyStateNavigationListener?;
|
|
767
|
+
private readonly noStateMachinePersistence;
|
|
768
|
+
private readonly authorizationRequestOpts?;
|
|
769
|
+
private readonly clientOpts?;
|
|
770
|
+
private readonly trustAnchors?;
|
|
771
|
+
constructor(args: Pick<GetMachineArgs, 'stateNavigationListener' | 'authorizationRequestOpts' | 'clientOpts' | 'trustAnchors' | 'firstPartyStateNavigationListener'> & {
|
|
772
|
+
priority?: number | DefaultLinkPriorities;
|
|
773
|
+
protocols?: Array<string | RegExp>;
|
|
774
|
+
noStateMachinePersistence?: boolean;
|
|
775
|
+
context: IAgentContext<IOID4VCIHolder & IMachineStatePersistence>;
|
|
776
|
+
});
|
|
777
|
+
handle(url: string | URL, opts?: {
|
|
778
|
+
machineState?: SerializableState;
|
|
779
|
+
authorizationRequestOpts?: AuthorizationRequestOpts;
|
|
780
|
+
createAuthorizationRequestURL?: boolean;
|
|
781
|
+
clientOpts?: AuthorizationServerClientOpts;
|
|
782
|
+
flowType?: AuthzFlowType;
|
|
783
|
+
}): Promise<void>;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export { type AccessTokenOpts, type AddContactIdentityArgs, type AssertValidCredentialsArgs, type Attribute, type AuthorizationResponseEvent, type ContactAliasEvent, type ContactConsentEvent, type CreateConfigArgs, type CreateContactEvent, type CreateCredentialsToSelectFromArgs, type CreateFirstPartyMachineOpts, type CreateIdentifierArgs, type CreateIdentifierCreateOpts, type CreateIdentifierOpts, type CreateOID4VCIMachineOpts, type CredentialToAccept, type CredentialToSelectFromResult, type CredentialVerificationError, type DeclineEvent, type DefaultIssuanceOpts, type DidAgents, type DynamicRegistrationClientMetadataDisplay, type ErrorDetails, type FirstPartyDeclineEvent, type FirstPartyMachineContext, type FirstPartyMachineEventTypes, FirstPartyMachineEvents, type FirstPartyMachineInterpreter, type FirstPartyMachineNavigationArgs, type FirstPartyMachineServiceDefinitions, FirstPartyMachineServices, type FirstPartyMachineState, type FirstPartyMachineStateNavigationListener, FirstPartyMachineStateTypes, type FirstPartyMachineStates, type FirstPartyMachineStatesConfig, type FirstPartyNextEvent, type FirstPartyPreviousEvent, type FirstPartySelectCredentialsEvent, type FirstPartyStateMachine, type GetAuthenticationKeyArgs, type GetBasicIssuerLocaleBrandingArgs, type GetContactArgs, type GetCredentialArgs, type GetCredentialBrandingArgs, type GetCredentialConfigsSupportedArgs, type GetCredentialConfigsSupportedBySingleTypeOrIdArgs, type GetCredentialsArgs, type GetDefaultIssuanceOptsArgs, type GetFederationTrustArgs, type GetIdentifierArgs, type GetIssuanceCryptoSuiteArgs, type GetIssuanceDidMethodArgs, type GetIssuanceOptsArgs, type GetIssuerBrandingArgs, type GetIssuerMetadataArgs, type GetMachineArgs, type GetOrCreatePrimaryIdentifierArgs, type GetPreferredCredentialFormatsArgs, type GetSiopRequestArgs, type IOID4VCIHolder, IdentifierAliasEnum, type InstanceFirstPartyMachineOpts, type InvokeAuthorizationRequestEvent, type IssuanceOpts, type IssuerLocaleBrandingFromArgs, type IssuerType, type MapCredentialToAcceptArgs, type MappedCredentialToAccept, type NextEvent, OID4VCICallbackStateListener, type OID4VCIContext, OID4VCIHolder, OID4VCIHolderEvent, OID4VCIHolderLinkHandler, type OID4VCIHolderOptions, type OID4VCIMachine, OID4VCIMachineAddContactStates, type OID4VCIMachineContext, type OID4VCIMachineEventTypes, OID4VCIMachineEvents, OID4VCIMachineGuards, type OID4VCIMachineInstanceOpts, type OID4VCIMachineInterpreter, type OID4VCIMachineNavigationArgs, type OID4VCIMachineServiceDefinitions, OID4VCIMachineServices, type OID4VCIMachineState, type OID4VCIMachineStateNavigationListener, OID4VCIMachineStates, OID4VCIMachineVerifyPinStates, type OID4VCIProviderProps, type OID4VCIStateMachine, type Oid4vciCombineDisplayLocalesFromArgs, type Oid4vciCredentialDisplayLocalesFromArgs, type Oid4vciCredentialLocaleBrandingFromArgs, type Oid4vciGetCredentialBrandingFromArgs, type Oid4vciIssuerCredentialSubjectLocalesFromArgs, type OnContactIdentityCreatedArgs, type OnCredentialStoredArgs, type OnIdentifierCreatedArgs, type PrepareStartArgs, type PreviousEvent, type RequestData, RequestType, type RequiredContext, type SdJwtCombineDisplayLocalesFromArgs, type SdJwtCredentialClaimLocalesFromArgs, type SdJwtCredentialDisplayLocalesFromArgs, type SdJwtCredentialLocaleBrandingFromArgs, type SdJwtGetCredentialBrandingFromArgs, type SelectAppLocaleBrandingArgs, type SelectCredentialsEvent, type SendAuthorizationChallengeRequestArgs, type SendAuthorizationResponseArgs, type SendNotificationArgs, type SetAuthorizationCodeURLEvent, type SiopV2AuthorizationRequestData, type StartFirstPartApplicationMachine, type StartResult, type StoreCredentialBrandingArgs, type StoreCredentialsArgs, type StoreIssuerBrandingArgs, SupportedLanguage, type VerificationCodeEvent, type VerificationResult, type VerificationSubResult, type VerifyCredentialArgs, type VerifyCredentialToAcceptArgs, type VerifyEBSICredentialIssuerArgs, type VerifyEBSICredentialIssuerResult, type VerifyMdocArgs, type VerifySDJWTCredentialArgs, createConfig, getBasicIssuerLocaleBranding, getCredentialBranding, getCredentialConfigsBasedOnFormatPref, getCredentialConfigsSupported, getCredentialConfigsSupportedBySingleTypeOrId, getCredentialConfigsSupportedMerged, getIdentifierOpts, getIssuanceCryptoSuite, getIssuanceMethod, getIssuanceOpts, getSiopRequest, issuerLocaleBrandingFrom, mapCredentialToAccept, oid4vciCombineDisplayLocalesFrom, oid4vciCredentialDisplayLocalesFrom, oid4vciCredentialLocaleBrandingFrom, oid4vciGetCredentialBrandingFrom, oid4vciHolderContextMethods, oid4vciIssuerCredentialSubjectLocalesFrom, sdJwtCombineDisplayLocalesFrom, sdJwtCredentialClaimLocalesFrom, sdJwtCredentialDisplayLocalesFrom, sdJwtCredentialLocaleBrandingFrom, sdJwtGetCredentialBrandingFrom, selectCredentialLocaleBranding, sendAuthorizationChallengeRequest, sendAuthorizationResponse, signCallback, startFirstPartApplicationMachine, verifyCredentialToAccept };
|