anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
119 lines • 3.33 kB
TypeScript
export interface Proof {
type: string;
created?: string;
verificationMethod: string;
proofPurpose: string;
proofValue?: string;
jws?: string;
challenge?: string;
domain?: string;
nonce?: string;
expires?: string;
[key: string]: any;
}
export interface CredentialStatus {
id: string;
type: string;
[key: string]: any;
}
export interface TermsOfUse {
type: string;
id?: string;
profile?: string;
prohibition?: Array<{
assigner: string;
assignee: string;
target: string;
action: string[];
}>;
obligation?: Array<{
assigner: string;
assignee: string;
target: string;
action: string[];
}>;
[key: string]: any;
}
export interface Evidence {
id?: string;
type: string | string[];
verifier?: string;
evidenceDocument?: string;
subjectPresence?: string;
documentPresence?: string;
licenseNumber?: string;
[key: string]: any;
}
export interface RefreshService {
id: string;
type: string;
[key: string]: any;
}
export interface CredentialSchema {
id: string;
type: string;
[key: string]: any;
}
export interface VerifiableCredentialV2 {
"@context": string | string[] | Record<string, any> | Array<string | Record<string, any>>;
id?: string;
type: string | string[];
issuer: string | {
id: string;
[key: string]: any;
};
validFrom?: string;
validUntil?: string;
credentialSubject: {
id?: string;
[key: string]: any;
} | Array<{
id?: string;
[key: string]: any;
}>;
proof?: Proof | Proof[];
credentialStatus?: CredentialStatus | CredentialStatus[];
termsOfUse?: TermsOfUse | TermsOfUse[];
evidence?: Evidence | Evidence[];
credentialSchema?: CredentialSchema | CredentialSchema[];
refreshService?: RefreshService | RefreshService[];
issuanceDate?: string;
expirationDate?: string;
}
export interface VerifiablePresentationV2 {
"@context": string | string[] | Record<string, any> | Array<string | Record<string, any>>;
id?: string;
type: string | string[];
verifiableCredential?: (VerifiableCredentialV2 | string)[];
holder?: string | {
id: string;
[key: string]: any;
};
proof?: Proof | Proof[];
termsOfUse?: TermsOfUse | TermsOfUse[];
}
export type SignatureSuiteType = string;
export declare enum ProofPurpose {
ASSERTION_METHOD = "assertionMethod",
AUTHENTICATION = "authentication",
KEY_AGREEMENT = "keyAgreement",
CAPABILITY_INVOCATION = "capabilityInvocation",
CAPABILITY_DELEGATION = "capabilityDelegation"
}
export declare enum CredentialStatusType {
REVOCATION_LIST_2020 = "RevocationList2020",
STATUS_LIST_2021 = "StatusList2021",
BITSTRING_STATUS_LIST = "BitstringStatusListEntry"
}
export declare const VC_V2_CONTEXTS: {
CREDENTIALS_V2: string;
CREDENTIALS_V1: string;
ED25519_2020: string;
BBS_2023: string;
DATA_INTEGRITY_V2: string;
STATUS_LIST_2021: string;
TERMS_OF_USE: string;
};
export declare function isVerifiableCredentialV2(credential: any): credential is VerifiableCredentialV2;
export type VerifiableCredentialCompat = VerifiableCredentialV2;
//# sourceMappingURL=vc2.d.ts.map