Class DidDocument

  • All Implemented Interfaces:

    
    public final class DidDocument
    
                        

    DidDocument represents a set of data describing the DID subject including mechanisms such as:

    • cryptographic public keys - used to authenticate itself and prove association with the DID

    • services - means of communicating or interacting with the DID subject or associated entities via one or more service endpoints. Examples include discovery services, agent services, social networking services, file storage services, and verifiable credential repository services. A DID Document can be retrieved by resolving a DID URI. DID Core spec: https://www.w3.org/TR/did-core/#core-properties

    • Method Detail

      • getId

         final String getId()

        the DID URI for a particular DID subject, expressed using the id property in the DID document.

      • getContext

         final List<String> getContext()

        a list of URI that defines the schema version used in the document.

      • getAlsoKnownAs

         final List<String> getAlsoKnownAs()

        AlsoKnownAs can contain multiple identifiers for different purposes, or at different times for the same DID subject. The assertion that two or more DIDs (or other types of URI) refer to the same DID subject can be made using the alsoKnownAs property.

      • getController

         final List<String> getController()

        defines an entity that is authorized to make changes to a DID document. The process of authorizing a DID controller is defined by the DID method. It can be a string or a list of strings.

      • getVerificationMethod

         final List<VerificationMethod> getVerificationMethod()

        a list of cryptographic public keys, which can be used to authenticate or authorize interactions with the DID subject or associated parties.

      • getService

         final List<Service> getService()

        expresses ways of communicating with the DID subject or associated entities. A service can be any type of service the DID subject wants to advertise.

      • getAssertionMethod

         final List<String> getAssertionMethod()

        used to specify how the DID subject is expected to express claims, such as for the purposes of issuing a Verifiable Credential.

      • getAuthentication

         final List<String> getAuthentication()

        specifies how the DID subject is expected to be authenticated, for purposes such as logging into a website or engaging in any sort of challenge-response protocol.

      • getKeyAgreement

         final List<String> getKeyAgreement()

        specifies how an entity can generate encryption material to transmit confidential information intended for the DID subject, such as for establishing a secure communication channel.

      • getCapabilityDelegation

         final List<String> getCapabilityDelegation()

        specifies a mechanism used by the DID subject to delegate a cryptographic capability to another party, such as delegating the authority to access a specific HTTP API.

      • getCapabilityInvocation

         final List<String> getCapabilityInvocation()

        specifies a verification method used by the DID subject to invoke a cryptographic capability, such as the authorization to update the DID Document.

      • selectVerificationMethod

         final VerificationMethod selectVerificationMethod(VMSelector selector)

        Select verification method takes a selector that can be used to select a specific verification method from the DID Document. If a selector is not provided, the first verification method is returned

        The selector can either be an ID, Purpose, or null. If a Purpose is provided, the first verification method in the DID Document that has the provided purpose will be returned.

        Parameters:
        selector - can either be an ID, Purpose, or null
        Returns:

        VerificationMethod matching the selector criteria

      • getAbsoluteResourceID

         final String getAbsoluteResourceID(String id)

        GetAbsoluteResourceID returns a fully qualified ID for a document resource (e.g. service, verification method) Document Resource IDs are allowed to be relative DID URLs as a means to reduce storage size of DID Documents. More info here: https://www.w3.org/TR/did-core/#relative-did-urls

        Parameters:
        id - of the resource
        Returns:

        fully qualified ID for a document resource