import { HederaDid } from "../../hedera-did"; import { DidSyntax } from "../../did-syntax"; import { FileId, PrivateKey, PublicKey, TopicId } from "@hashgraph/sdk"; import { DidDocumentBase } from "../../did-document-base"; /** * Hedera Decentralized Identifier for Hedera DID Method specification based on HCS. */ export declare class HcsDid implements HederaDid { static DID_METHOD: DidSyntax.Method; private static DID_PARAMETER_VALUE_PARTS; private didTopicId; private addressBookFileId; private network; private idString; private did; private didRootKey; private privateDidRootKey; /** * Creates a DID instance. * * @param network The Hedera DID network. * @param didRootKey The public key from which DID is derived. * @param addressBookFileId The appent's address book {@link FileId} * @param didTopicId The appnet's DID topic ID. */ constructor(network: string, didRootKey: PublicKey, addressBookFileId: FileId, didTopicId?: TopicId); /** * Creates a DID instance with private DID root key. * * @param network The Hedera DID network. * @param privateDidRootKey The private DID root key. * @param addressBookFileId The appent's address book {@link FileId} * @param didTopicId The appnet's DID topic ID. */ constructor(network: string, privateDidRootKey: PrivateKey, addressBookFileId: FileId, didTopicId?: TopicId); /** * Creates a DID instance without topic ID specification. * * @param network The Hedera DID network. * @param didRootKey The public key from which DID is derived. * @param addressBookFileId The appent's address book {@link FileId} */ constructor(network: string, didRootKey: PublicKey, addressBookFileId: FileId); /** * Creates a DID instance. * * @param network The Hedera DID network. * @param idString The id-string of a DID. * @param addressBookFileId The appent's address book {@link FileId} * @param didTopicId The appnet's DID topic ID. */ constructor(network: string, idString: string, addressBookFileId: FileId, didTopicId?: TopicId); /** * Converts a Hedera DID string into {@link HcsDid} object. * * @param didString A Hedera DID string. * @return {@link HcsDid} object derived from the given Hedera DID string. */ static fromString(didString: string): HcsDid; /** * Extracts method-specific URL parameters. * * @param mainParts Iterator over main parts of the DID. * @param methodName The method name. * @param networkName The network name. * @return A map of method-specific URL parameters and their values. */ private static extractParameters; /** * Generates a random DID root key. * * @return A private key of generated public DID root key. */ static generateDidRootKey(): PrivateKey; /** * Generates DID document base from the given DID and its root key. * * @param didRootKey Public key used to build this DID. * @return The DID document base. * @throws IllegalArgumentException In case given DID root key does not match this DID. */ generateDidDocument(): DidDocumentBase; getNetwork(): string; getMethod(): DidSyntax.Method; toString(): string; getDidTopicId(): TopicId; getAddressBookFileId(): FileId; getIdString(): string; toDid(): string; /** * Constructs DID string from the instance of DID object. * * @return A DID string. */ private buildDid; /** * Constructs an id-string of a DID from a given public key. * * @param didRootKey Public Key from which the DID is created. * @return The id-string of a DID that is a Base58-encoded SHA-256 hash of a given public key. */ static publicKeyToIdString(didRootKey: PublicKey): string; /** * Returns a private key of DID root key. * This is only available if it was provided during {@link HcsDid} construction. * * @return The private key of DID root key. */ getPrivateDidRootKey(): PrivateKey; /** * Returns a public key of DID root key. * This is only available if it was provided during {@link HcsDid} construction. * * @return The private key of DID root key. */ getPublicDidRootKey(): PublicKey; }