import { Timestamp } from "@hashgraph/sdk"; import { HcsDid } from "../did/hcs-did"; import { JsonClass } from "../json-class"; import { CredentialSubject } from "./credential-subject"; import { HcsVcDocumentHashBase } from "./hcs-vc-document-hash-base"; import { Issuer } from "./issuer"; /** * The base for a VC document generation in JSON-LD format. * VC documents according to W3C draft specification must be compatible with JSON-LD version 1.1 Up until now there is * no Java implementation library of JSON-LD version 1.1. For that reason this object represents only the most basic and * mandatory attributes from the VC specification and Hedera HCS DID method specification point of view. Applications * shall extend it with any VC document properties or custom properties they require. */ export declare class HcsVcDocumentBase extends HcsVcDocumentHashBase { protected context: string[]; protected credentialSubject: T[]; /** * Creates a new VC Document instance. */ constructor(); /** * Constructs a credential hash that uniquely identifies this verifiable credential. * This is not a credential ID, but a hash composed of the properties included in HcsVcDocumentHashBase class * (excluding issuer name). * Credential hash is used to find the credential on Hedera VC registry. * Due to the nature of the VC document the hash taken from the base mandatory fields in this class * and shall produce a unique constant. * W3C specification defines ID field of a verifiable credential as not mandatory, however Hedera requires issuers to * define this property for each VC. * * @return The credential hash uniquely identifying this verifiable credential. */ toCredentialHash(): string; getContext(): string[]; getId(): string; getType(): string[]; getIssuer(): Issuer; getIssuanceDate(): Timestamp; getCredentialSubject(): T[]; setId(id: string): void; setIssuer(issuerDid: string): void; setIssuer(issuer: Issuer): void; setIssuer(issuerDid: HcsDid): void; setIssuanceDate(issuanceDate: Timestamp): void; /** * Adds an additional context to @context field of the VC document. * * @param context The context to add. */ addContext(context: string): void; /** * Adds an additional type to `type` field of the VC document. * * @param type The type to add. */ addType(type: string): void; /** * Adds a credential subject. * * @param credentialSubject The credential subject to add. */ addCredentialSubject(credentialSubject: T): void; /** * Checks if all mandatory fields of a VC document are filled in. * * @return True if the document is complete and false otherwise. */ isComplete(): boolean; toJsonTree(): any; static fromJsonTree(root: any, result?: HcsVcDocumentBase, credentialSubjectClass?: JsonClass): HcsVcDocumentBase; /** * Converts this document into a JSON string. * * @return The JSON representation of this document. */ toJSON(): string; /** * Converts a VC document in JSON format into a {@link HcsVcDocumentBase} object. * Please note this conversion respects only the fields of the base VC document. All other fields are ignored. * * @param The type of the credential subject. * @param json The VC document as JSON string. * @param credentialSubjectClass The type of the credential subject inside. * @return The {@link HcsVcDocumentBase} object. */ static fromJson(json: string, credentialSubjectClass?: JsonClass): HcsVcDocumentBase; }