Package web5.sdk.dids

Class BearerDid

  • All Implemented Interfaces:

    
    public final class BearerDid
    
                        

    Represents a Decentralized Identifier (DID) along with its DID document, key manager, metadata, and convenience functions.

    A BearerDid encapsulates a DID and its associated DID document. It provides functionality for working with the DID's keys, managing key signers, and exporting the DID as a PortableDid.

    • Constructor Detail

      • BearerDid

        BearerDid(Did did, Document document, KeyManager keyManager)
        Constructs a new BearerDid from the provided DID, document, and key manager.
        Parameters:
        did - The DID.
        document - The DID document.
        keyManager - The key manager used for key storage and signing.
    • Method Detail

      • getDid

         final Did getDid()

        The DID associated with this instance.

      • getSigner

         final Signer getSigner(String verificationMethodId)

        Returns a signer for the DID.

        This method retrieves a signer associated with the specified verification method. The signer can be used to cryptographically sign data using the DID's key material.

        Parameters:
        verificationMethodId - The ID of the verification method to use.
        Returns:

        A Signer instance for signing data.

      • toPortableDid

         final PortableDid toPortableDid(KeyExporter keyExporter)

        Returns the BearerDid represented as a PortableDid.

        This method exports the BearerDid as a PortableDid, allowing for easy transport and storage across different systems or platforms.

        Parameters:
        keyExporter - The key exporter to use for exporting the private keys.
        Returns:

        A PortableDid object representing the exported DID.