UMIS SDK
    Preparing search index...

    Function signRelayCommand

    • Signs a relay command: an umis-relay-cmd+jwt that authorises exactly one HTTP body for one relay. It carries the relay it is meant for (aud), its lifetime (ttlSeconds, 10 by default and 30 at most), a random single-use jti of 16 bytes and bh, the SHA-256 of the UTF-8 body as base64url, so that the body cannot be swapped after signing. iss names the station or device that sends the command. The result goes into the X-Umis-Command header of the request whose body is body. The function runs in browsers: signing and hashing go through the crypto provider.

      Parameters

      • i: {
            body: string;
            crypto?: CryptoProvider;
            iss?: string;
            now: number;
            relayAud: string;
            signer: Signer;
            ttlSeconds?: number;
        }

      Returns Promise<string>