@sphereon/openid4vci-client
Version:
OpenID for Verifiable Credential Issuance (OpenID4VCI) client
87 lines (86 loc) • 2.3 kB
TypeScript
import { CredentialFormat, W3CVerifiableCredential } from '@sphereon/ssi-types';
export interface CredentialRequest {
type: string | string[];
format: CredentialFormat | CredentialFormat[];
proof: ProofOfPossession;
}
export interface CredentialResponse {
credential: W3CVerifiableCredential;
format: CredentialFormat;
}
export interface IssuanceInitiationWithBaseUrl {
baseUrl: string;
issuanceInitiationRequest: IssuanceInitiationRequestPayload;
}
export interface IssuanceInitiationRequestPayload {
issuer: string;
credential_type: string[] | string;
'pre-authorized_code'?: string;
user_pin_required?: boolean | string;
op_state?: string;
}
export declare enum ProofType {
JWT = "jwt"
}
export interface ProofOfPossession {
proof_type: ProofType;
jwt: string;
[x: string]: unknown;
}
export declare type SearchValue = {
[Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
};
export declare type EncodeJsonAsURIOpts = {
uriTypeProperties?: string[];
arrayTypeProperties?: string[];
baseUrl?: string;
};
export declare type DecodeURIAsJsonOpts = {
requiredProperties?: string[];
arrayTypeProperties?: string[];
};
export interface JWK {
kty?: string;
crv?: string;
x?: string;
y?: string;
e?: string;
n?: string;
}
export interface Jwt {
header?: JWTHeader;
payload?: JWTPayload;
}
export interface ProofOfPossessionCallbacks {
signCallback: JWTSignerCallback;
verifyCallback?: JWTVerifyCallback;
}
export declare enum Alg {
EdDSA = "EdDSA",
ES256 = "ES256",
ES256K = "ES256K"
}
export declare enum Typ {
JWT = "JWT"
}
export interface JWTHeader {
alg: Alg | string;
typ?: string;
kid?: string;
jwk?: JWK;
x5c?: string[];
}
export interface JWTPayload {
iss?: string;
aud?: string;
iat?: number;
nonce?: string;
jti?: string;
exp?: number;
}
export declare type JWTSignerCallback = (jwt: Jwt, kid: string) => Promise<string>;
export declare type JWTVerifyCallback = (args: {
jwt: string;
kid: string;
}) => Promise<void>;
export declare type Request = CredentialRequest;