Static
chunkSplits a string into chunks of length 255 if the string exceeds length 255.
The string to split into chunks.
The original string if its length is less than or equal to 255, otherwise an array of chunked strings.
Static
createCreates a BEP44 put message, which is used to publish a DID document to the DHT network.
The parameters to use when creating the BEP44 put message
The DNS packet to encode in the BEP44 message.
The public key bytes of the Identity Key.
Signer that can sign and verify data using the Identity Key.
A promise that resolves to a BEP44 put message.
Static
identifierConverts a DID URI to a JSON Web Key (JWK) representing the Identity Key.
The parameters to use for the conversion.
The DID URI containing the Identity Key.
A promise that resolves to a JWK representing the Identity Key.
Static
identifierConverts a DID URI to the byte array representation of the Identity Key.
The parameters to use for the conversion.
The DID URI containing the Identity Key.
A byte array representation of the Identity Key.
Static
identityEncodes a DID DHT Identity Key into a DID identifier.
This method first z-base-32 encodes the Identity Key. The resulting string is prefixed with
did:dht:
to form the DID identifier.
A promise that resolves to a string containing the DID identifier.
Static
keyReturns the appropriate key converter for the specified cryptographic curve.
The cryptographic curve to use for the key conversion.
An AsymmetricKeyConverter
for the specified curve.
Static
parseParses and verifies a BEP44 Get message, converting it to a DNS packet.
The parameters to use when verifying and parsing the BEP44 Get response message.
The BEP44 message to verify and parse.
A promise that resolves to a DNS packet.
Static
parseStatic
parseStatic
validateValidates the proof of previous DID given.
The parameters to validate the previous DID proof.
The new DID that the previous DID is linking to.
The proof of the previous DID, containing the previous DID and signature signed by the previous DID.
The
DidDhtUtils
class provides utility functions to support operations in the DID DHT method. This includes functions for creating and parsing BEP44 messages, handling identity keys, and converting between different formats and representations.