Package web5.sdk.dids
Class PortableDid
-
- All Implemented Interfaces:
public final class PortableDidRepresents a portable DID (Decentralized Identifier) and its associated data, such as the DID document and private keys.
A
PortableDidallows the DID, its document, and associated private keys to be transported, saved, or shared across systems in a portable format.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPortableDid.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StringdidUriprivate final Documentdocumentprivate final List<Jwk>privateKeyspublic final static PortableDid.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description PortableDid(String didUri, Document document, List<Jwk> privateKeys)Constructs a PortableDidinstance from a DID URI, document, and list of private keys.
-
Method Summary
Modifier and Type Method Description final StringgetDidUri()The DID URI associated with the portable DID. final DocumentgetDocument()The DID document associated with the portable DID. final List<Jwk>getPrivateKeys()A list of private keys (JWK format) associated with the DID. final StringtoJsonString()Serializes the PortableDidto a JSON string.-
-
Constructor Detail
-
PortableDid
PortableDid(String didUri, Document document, List<Jwk> privateKeys)
Constructs aPortableDidinstance from a DID URI, document, and list of private keys.- Parameters:
didUri- The DID URI associated with the portable DID.document- The DID document associated with the portable DID.privateKeys- A list of private keys (JWK format) associated with the DID.
-
-
Method Detail
-
getDocument
final Document getDocument()
The DID document associated with the portable DID.
-
getPrivateKeys
final List<Jwk> getPrivateKeys()
A list of private keys (JWK format) associated with the DID.
-
toJsonString
final String toJsonString()
Serializes the
PortableDidto a JSON string.This method converts the
PortableDidinstance into a JSON string using Rust core functionality.- Returns:
A JSON string representing the portable DID.
-
-
-
-