@ew-did-registry/claims
Version:
The package exposes functionality needed to create, inspect, approve, and verify Private and Public claims
56 lines (48 loc) • 1.23 kB
text/typescript
import { IJWT } from '@ew-did-registry/jwt';
import { StatusList2021Entry } from '@ew-did-registry/credentials-interface';
export interface IPublicClaim{
did: string;
signer: string;
claimData: object;
credentialStatus?: StatusList2021Entry;
exp?: number,
[key: string]: string | object | undefined | number;
}
export interface IPrivateClaim {
did: string;
signer: string;
claimData: { [key: string]: string | [] }; // so that they can be salted
[key: string]: string | object;
}
export interface IProofData {
[key: string]: {
value: string | object; // string - for non-encrypted, {h,s} - for encrypted
encrypted: boolean;
};
}
export interface IProofClaim {
did: string;
signer: string;
claimUrl: string;
proofData: IProofData;
[key: string]: string | object;
}
export interface ISaltedFields {
[key: string]: string;
}
export interface IClaims {
did: string;
keys: {
privateKey?: string;
publicKey: string;
};
jwt: IJWT;
verify(
claimUrl: string,
hashFns?: { [hashAlg: string]: (data: string) => string }
): Promise<IPublicClaim | IPrivateClaim>;
}
export enum VerificationPurpose {
Authentication = 'Authentication',
Assertion = 'Assertion',
}