Object DidKey.Companion

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final BearerDid create(KeyManager keyManager, CreateDidKeyOptions options) Creates a new "did:key" DID, derived from a public key, and stores the associated private key in the provided KeyManager.
      final BearerDid create(KeyManager keyManager) Creates a new "did:key" DID, derived from a public key, and stores the associated private key in the provided KeyManager.
      final DidResolutionResult resolve(String did) Resolves a "did:key" DID into a DidResolutionResult, which contains the DID Document and possible related metadata.
      final BearerDid import(PortableDid portableDid, KeyManager keyManager) Instantiates a BearerDid object for the DID KEY method from a given PortableDid.
      final BearerDid import(PortableDid portableDid) Instantiates a BearerDid object for the DID KEY method from a given PortableDid.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • create

        @JvmOverloads() final BearerDid create(KeyManager keyManager, CreateDidKeyOptions options)

        Creates a new "did:key" DID, derived from a public key, and stores the associated private key in the provided KeyManager.

        The method-specific identifier of a "did:key" DID is a multibase encoded public key.

        Note: Defaults to ES256K if no options are provided

        Parameters:
        keyManager - A KeyManager instance where the new key will be stored.
        options - Optional parameters (CreateDidKeyOptions) to specify algorithmId during key creation.
        Returns:

        A DidKey instance representing the newly created "did:key" DID.

      • create

        @JvmOverloads() final BearerDid create(KeyManager keyManager)

        Creates a new "did:key" DID, derived from a public key, and stores the associated private key in the provided KeyManager.

        The method-specific identifier of a "did:key" DID is a multibase encoded public key.

        Note: Defaults to ES256K if no options are provided

        Parameters:
        keyManager - A KeyManager instance where the new key will be stored.
        Returns:

        A DidKey instance representing the newly created "did:key" DID.

      • resolve

         final DidResolutionResult resolve(String did)

        Resolves a "did:key" DID into a DidResolutionResult, which contains the DID Document and possible related metadata.

        This implementation primarily constructs a DID Document with a single verification method derived from the DID's method-specific identifier (the public key).

        Parameters:
        did - The "did:key" DID that needs to be resolved.
        Returns:

        A DidResolutionResult instance containing the DID Document and related context.

      • import

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

        Instantiates a BearerDid object for the DID KEY 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 KEY 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.