import { PublicKey, Timestamp, TopicId } from "@hashgraph/sdk"; import { DidMethodOperation } from "../../did-method-operation"; import { Decrypter, Encrypter, Message } from "../message"; import { MessageEnvelope } from "../message-envelope"; /** * The DID document message submitted to appnet's DID Topic. */ export declare class HcsDidMessage extends Message { protected operation: DidMethodOperation; protected did: string; protected didDocumentBase64: string; /** * The date when the DID was created and published. * It is equal to consensus timestamp of the first creation message. * This property is set by the listener and injected into the DID document upon calling getDidDocument() method. */ protected created: Timestamp; /** * The date when the DID was updated and published. * It is equal to consensus timestamp of the last valid update or delete message. * This property is set by the listener and injected into the DID document upon calling getDidDocument() method. */ protected updated: Timestamp; /** * Creates a new instance of {@link HcsDidMessage}. * * @param operation The operation on DID document. * @param did The DID string. * @param didDocumentBase64 The Base64-encoded DID document. */ constructor(operation: DidMethodOperation, did: string, didDocumentBase64: string); getOperation(): DidMethodOperation; getDid(): string; getDidDocumentBase64(): string; getCreated(): Timestamp; getUpdated(): Timestamp; setUpdated(updated: Timestamp): void; setCreated(created: Timestamp): void; /** * Decodes didDocumentBase64 field and returns its content. * In case this message is in encrypted mode, it will return encrypted content, * so getPlainDidDocument method should be used instead. * If message consensus timestamps for creation and update are provided they will be injected into the result * document upon decoding. * * @return The decoded DID document as JSON string. */ getDidDocument(): string; /** * Validates this DID message by checking its completeness, signature and DID document. * * @return True if the message is valid, false otherwise. */ isValid(): boolean; /** * Validates this DID message by checking its completeness, signature and DID document. * * @param didTopicId The DID topic ID against which the message is validated. * @return True if the message is valid, false otherwise. */ isValid(didTopicId: TopicId): boolean; /** * Extracts #did-root-key from the DID document. * * @return Public key of the DID subject. */ extractDidRootKey(): PublicKey; toJsonTree(): any; static fromJsonTree(tree: any, result?: HcsDidMessage): HcsDidMessage; toJSON(): string; static fromJson(json: string): Message; /** * Creates a new DID message for submission to HCS topic. * * @param didDocumentJson DID document as JSON string. * @param operation The operation on DID document. * @return The HCS message wrapped in an envelope for the given DID document and method operation. */ static fromDidDocumentJson(didDocumentJson: string, operation: DidMethodOperation): MessageEnvelope; /** * Provides an encryption operator that converts an {@link HcsDidMessage} into encrypted one. * * @param encryptionFunction The encryption function to use for encryption of single attributes. * @return The encryption operator instance. */ static getEncrypter(encryptionFunction: Encrypter): Encrypter; /** * Provides a decryption function that converts {@link HcsDidMessage} in encrypted for into a plain form. * * @param decryptionFunction The decryption function to use for decryption of single attributes. * @return The Decryption function for the {@link HcsDidMessage} */ static getDecrypter(decryptionFunction: Decrypter): Decrypter; }