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

    Interface IMultikey

    Interface representing a BIP340 Multikey. IMultikey

    interface IMultikey {
        controller: string;
        id: string;
        isSigner: boolean;
        keyPair: KeyPair;
        privateKey?: PrivateKey;
        publicKey: PublicKey;
        fromVerificationMethod(verificationMethod: DidVerificationMethod): Multikey;
        fullId(): string;
        json(): MultikeyJSON;
        sign(data: Bytes): Bytes;
        toVerificationMethod(): DidVerificationMethod;
        verify(signature: Bytes, message: string): boolean;
    }

    Implemented by

    Index

    Properties

    controller: string
    id: string
    isSigner: boolean
    keyPair: KeyPair
    privateKey?: PrivateKey
    publicKey: PublicKey

    Methods

    • Convert a verification method to a multikey.

      Parameters

      • verificationMethod: DidVerificationMethod

        The verification method to convert.

      Returns Multikey

      Multikey instance.

      if the verification method is missing required fields. if the verification method has an invalid type. if the publicKeyMultibase has an invalid prefix.

    • Get the full id of the multikey

      Returns string

      The full id of the multikey

    • Produce signed data with a private key.

      Parameters

      • data: Bytes

        Data to be signed.

      Returns Bytes

      Signature byte array.

      if no private key is provided.

    • Convert the multikey to a verification method.

      Returns DidVerificationMethod

      The verification method.

    • Verify a signature.

      Parameters

      • signature: Bytes

        Signature for verification.

      • message: string

        Data for verification.

      Returns boolean

      If the signature is valid against the public key.