@affinityproject/common-lib
Version:
common lib for affinity DID solution
46 lines (45 loc) • 1.71 kB
TypeScript
import { VCV1Unsigned, VCV1, VPV1, VPV1Unsigned } from '@affinityproject/vc-common';
import { AffinityOptions } from './dto/shared.dto';
export declare class Affinity {
private readonly _apiKey;
private readonly _registryUrl;
private readonly _digestService;
constructor(options?: AffinityOptions);
private _resolveDidIfNoDidDocument;
resolveDid(did: string): Promise<any>;
validateJWT(encryptedtoken: string, initialEncryptedtoken?: string, didDocument?: any): Promise<void>;
private _validateLegacyCredential;
private readonly _documentLoader;
_checkCredentialStatus(credential: any): Promise<{
verified: boolean;
error?: string;
}>;
validateCredential(credential: any, holderKey?: string, didDocument?: any): Promise<{
result: boolean;
error: string;
}>;
signCredential<VC extends VCV1Unsigned>(unsignedCredential: VC, encryptedSeed: string, encryptionKey: string): Promise<VCV1>;
validatePresentation(vp: any, didDocument?: any): Promise<{
result: true;
data: VPV1;
} | {
result: false;
error: string;
}>;
signPresentation(opts: {
vp: VPV1Unsigned;
encryption: {
seed: string;
key: string;
};
purpose: {
challenge: string;
domain: string;
};
}): Promise<VPV1>;
private _getCredentialIssuerPublicKey;
static fromJwt(jwt: string): any;
static signJWTObject(jwtObject: any, encryptedSeed: string, encryptionKey: string): any;
static encodeObjectToJWT(jwtObject: any): string;
static encryptSeed(seedHexWithMethod: string, encryptionKey: string): Promise<string>;
}