@sphereon/openid4vci-client
Version:
OpenID for Verifiable Credential Issuance (OpenID4VCI) client
54 lines (53 loc) • 2.38 kB
TypeScript
import { CredentialFormat } from '@sphereon/ssi-types';
import { AccessTokenResponse, Alg, AuthorizationRequestOpts, AuthzFlowType, CredentialMetadata, CredentialResponse, CredentialsSupported, EndpointMetadata, IssuanceInitiationWithBaseUrl, ProofOfPossessionCallbacks } from './types';
export declare class OpenID4VCIClient {
private readonly _flowType;
private readonly _initiation;
private _clientId?;
private _kid;
private _alg;
private _serverMetadata;
private _accessTokenResponse;
private constructor();
static initiateFromURI({ issuanceInitiationURI, flowType, kid, alg, retrieveServerMetadata, clientId, }: {
issuanceInitiationURI: string;
flowType: AuthzFlowType;
kid?: string;
alg?: Alg | string;
retrieveServerMetadata?: boolean;
clientId?: string;
}): Promise<OpenID4VCIClient>;
retrieveServerMetadata(): Promise<EndpointMetadata>;
createAuthorizationRequestUrl({ clientId, codeChallengeMethod, codeChallenge, redirectUri, scope }: AuthorizationRequestOpts): string;
acquireAccessToken({ pin, clientId, codeVerifier, code, redirectUri, }: {
pin?: string;
clientId?: string;
codeVerifier?: string;
code?: string;
redirectUri?: string;
}): Promise<AccessTokenResponse>;
acquireCredentials({ credentialType, proofCallbacks, format, kid, alg, jti, }: {
credentialType: string | string[];
proofCallbacks: ProofOfPossessionCallbacks;
format?: CredentialFormat | CredentialFormat[];
kid?: string;
alg?: Alg | string;
jti?: string;
}): Promise<CredentialResponse>;
getCredentialsSupported(restrictToInitiationTypes: boolean): CredentialsSupported;
getCredentialMetadata(type: string): CredentialMetadata;
getCredentialTypesFromInitiation(): string[];
get flowType(): AuthzFlowType;
get initiation(): IssuanceInitiationWithBaseUrl;
get serverMetadata(): EndpointMetadata;
get kid(): string;
get alg(): string;
get clientId(): string;
get accessTokenResponse(): AccessTokenResponse;
getIssuer(): string;
getAccessTokenEndpoint(): string;
getCredentialEndpoint(): string;
private assertInitiation;
private assertServerMetadata;
private assertAccessToken;
}