Class BearerDid
-
- All Implemented Interfaces:
public final class BearerDidRepresents a Decentralized Identifier (DID) along with its DID document, key manager, metadata, and convenience functions.
A
BearerDidencapsulates 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBearerDid.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Diddidprivate final Documentdocumentprivate final KeyManagerkeyManagerpublic final static BearerDid.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description BearerDid(Did did, Document document, KeyManager keyManager)Constructs a new BearerDid from the provided DID, document, and key manager.
-
Method Summary
Modifier and Type Method Description final DidgetDid()The DID associated with this instance. final DocumentgetDocument()The DID document associated with this instance. final KeyManagergetKeyManager()The KeyManager associated with this instance. final SignergetSigner(String verificationMethodId)Returns a signer for the DID. final PortableDidtoPortableDid(KeyExporter keyExporter)Returns the BearerDid represented 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
-
getDocument
final Document getDocument()
The DID document associated with this instance.
-
getKeyManager
final KeyManager getKeyManager()
The KeyManager 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
BearerDidas aPortableDid, 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.
-
-
-
-