@did-btc1/method
    Preparing search index...

    Interface KeyManager

    The interface for the Btc1KeyManager class. KeyManager

    interface KeyManager {
        activeKeyUri?: string;
        exportKey(keyUri?: string): Promise<undefined | Multikey>;
        getPublicKey(keyUri: string): Promise<PublicKey>;
        importKey(
            keyPair: SchnorrKeyPair,
            keyUri: string,
            options: Btc1KeyManagerOptions,
        ): Promise<string>;
    }

    Implemented by

    Index

    Properties

    activeKeyUri?: string

    The URI of the active key.

    Methods

    • Exports the full key pair from the key store.

      Parameters

      • OptionalkeyUri: string

        The URI of the key to export.

      Returns Promise<undefined | Multikey>

      The key pair associated with the key URI.

      If the key is not found in the key store.

    • Gets the public key of a key pair.

      Parameters

      • keyUri: string

        The URI of the key to get the public key for.

      Returns Promise<PublicKey>

      The public key of the key pair.

    • Imports a key pair into the key store.

      Parameters

      • keyPair: SchnorrKeyPair

        The key pair to import.

      • keyUri: string

        The full DID controller + fragment identifier (e.g. 'did:btc1:xyz#key-1').

      • options: Btc1KeyManagerOptions

        The options for importing the key pair.

        • Optionalactive?: boolean
        • OptionalimportKey?: boolean

      Returns Promise<string>

      A promise that resolves to the key identifier of the imported key.