Package web5.sdk.dids

Class PortableDid

  • All Implemented Interfaces:

    
    public final class PortableDid
    
                        

    Represents a portable DID (Decentralized Identifier) and its associated data, such as the DID document and private keys.

    A PortableDid allows 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 class PortableDid.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      PortableDid(String didUri, Document document, List<Jwk> privateKeys) Constructs a PortableDid instance from a DID URI, document, and list of private keys.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getDidUri() The DID URI associated with the portable DID.
      final Document getDocument() The DID document associated with the portable DID.
      final List<Jwk> getPrivateKeys() A list of private keys (JWK format) associated with the DID.
      final String toJsonString() Serializes the PortableDid to a JSON string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PortableDid

        PortableDid(String didUri, Document document, List<Jwk> privateKeys)
        Constructs a PortableDid instance 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

      • getDidUri

         final String getDidUri()

        The DID URI 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 PortableDid to a JSON string.

        This method converts the PortableDid instance into a JSON string using Rust core functionality.

        Returns:

        A JSON string representing the portable DID.