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

    Interface Multikey

    Interface for a 2.1.1 Multikey. Multikey

    interface Multikey {
        controller: string;
        id: string;
        keys: SchnorrKeyPair;
        publicKey: PublicKey;
        secretKey?: SecretKey;
        signer: boolean;
        fromVerificationMethod(verificationMethod: DidVerificationMethod): Multikey;
        fullId(): string;
        json(): MultikeyObject;
        sign(data: Bytes, opts: { scheme: "ecdsa" | "schnorr" }): Bytes;
        toVerificationMethod(): DidVerificationMethod;
        verify(
            signature: Bytes,
            message: string,
            opts: { scheme: "ecdsa" | "schnorr" },
        ): boolean;
    }

    Implemented by

    Index

    Properties

    controller: string
    id: string
    keys: SchnorrKeyPair
    publicKey: PublicKey
    secretKey?: SecretKey
    signer: boolean

    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 secret key.

      Parameters

      • data: Bytes

        Data to be signed.

      • opts: { scheme: "ecdsa" | "schnorr" }

      Returns Bytes

      Signature byte array.

      if no secret key is provided.

    • Convert the multikey to a verification method.

      Returns DidVerificationMethod

      The verification method.

    • Verify a schnorr signature.

      Parameters

      • signature: Bytes

        Signature for verification.

      • message: string

        Data for verification.

      • opts: { scheme: "ecdsa" | "schnorr" }

      Returns boolean

      If the signature is valid against the public key.