Class DidWebApi

  • All Implemented Interfaces:

    
    public class DidWebApi
    
                        

    Implements resolve according to https://w3c-ccg.github.io/did-method-web/

    • Constructor Detail

    • Method Detail

      • resolve

         final DidResolutionResult resolve(String did)

        Resolves a did:jwk URI into a DidResolutionResult.

        This method parses the provided did URI to extract the Jwk information. It validates the method of the DID URI and then attempts to parse the Jwk from the URI. If successful, it constructs a DidDocument with the resolved Jwk, generating a DidResolutionResult.

        The method ensures that the DID URI adheres to the did:jwk method specification and handles exceptions that may arise during the parsing and resolution process.

        Parameters:
        did - did URI to parse
        Returns:

        DidResolutionResult containing the resolved DID document. If the DID URI is invalid, not conforming to the did:jwk method, or if any other error occurs during the resolution process, it returns an invalid DidResolutionResult.

      • import

        @JvmOverloads() final BearerDid import(PortableDid portableDid, KeyManager keyManager)

        Instantiates a BearerDid object for the DID WEB method from a given PortableDid.

        This method allows for the creation of a BearerDid object using a previously created DID's key material, DID document, and metadata.

        Parameters:
        portableDid -
        • The PortableDid object to import.

        keyManager -
        • Optionally specify an external Key Management System (KMS) used to generate keys and sign data. If not given, a new InMemoryKeyManager instance will be created and used.

      • import

        @JvmOverloads() final BearerDid import(PortableDid portableDid)

        Instantiates a BearerDid object for the DID WEB method from a given PortableDid.

        This method allows for the creation of a BearerDid object using a previously created DID's key material, DID document, and metadata.

        Parameters:
        portableDid -
        • The PortableDid object to import.