@sovereignbase/cryptosuite
    Preparing search index...

    Class MessageAuthenticationCluster

    Routes message authentication operations through cached key harness instances.

    Index
    • Produces a message authentication tag for the provided bytes.

      Parameters

      • messageAuthenticationKey: JsonWebKey & {
            crv?: undefined;
            d?: undefined;
            dp?: undefined;
            dq?: undefined;
            e?: undefined;
            n?: undefined;
            oth?: undefined;
            p?: undefined;
            q?: undefined;
            qi?: undefined;
            x?: undefined;
            y?: undefined;
        } & {
            alg: "HS256";
            k: string;
            key_ops: readonly ("sign" | "verify")[];
            kty: "oct";
            use: "sig";
        }

        The symmetric authentication key to use.

      • bytes: Uint8Array

        The message bytes to authenticate.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The computed authentication tag.

    • Verifies a message authentication tag for the provided bytes.

      Parameters

      • messageAuthenticationKey: JsonWebKey & {
            crv?: undefined;
            d?: undefined;
            dp?: undefined;
            dq?: undefined;
            e?: undefined;
            n?: undefined;
            oth?: undefined;
            p?: undefined;
            q?: undefined;
            qi?: undefined;
            x?: undefined;
            y?: undefined;
        } & {
            alg: "HS256";
            k: string;
            key_ops: readonly ("sign" | "verify")[];
            kty: "oct";
            use: "sig";
        }

        The symmetric authentication key to use.

      • bytes: Uint8Array

        The message bytes to verify.

      • signature: Uint8Array

        The authentication tag to verify.

      Returns Promise<boolean>

      true when the tag is valid; otherwise false.