gnap-caep-client
    Preparing search index...

    Function signRequest

    • Signs a request for GNAP's httpsig proof (RFC 9635 section 7.3.1). The signature covers @method, @target-uri, content-digest when there is content, and authorization when an access token is presented, with created, a fresh nonce, the key's keyid and the gnap tag.

      Parameters

      • req: {
            body?: string | Uint8Array<ArrayBufferLike>;
            created?: number;
            headers?: Record<string, string>;
            key: {
                thumbprint: string;
                sign(data: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>;
            };
            label?: string;
            method: string;
            nonce?: string;
            url: string;
        }

      Returns Promise<Record<string, string>>

      the headers to add: signature, signature-input, and content-digest when there is content