@types/hawk
Version:
TypeScript definitions for hawk
39 lines (27 loc) • 1.13 kB
TypeScript
import * as Crypto from "crypto";
import * as Client from "./client";
export interface Artifacts {
app?: string | undefined;
dlg?: string | undefined;
ext?: string | undefined;
hash?: string | undefined;
host: string;
method: string;
nonce: string;
port: number;
resource: string;
ts: string;
}
export interface TimestampMessage {
ts: number;
tsm: string;
}
export const headerVersion: string;
export const algorithms: string[];
export function calculateMac(type: string, credentials: Client.Credentials, options: Artifacts): string;
export function generateNormalizedString(type: string, options: Artifacts): string;
export function calculatePayloadHash(payload: string, algorithm: string, contentType: string): string;
export function initializePayloadHash(algorithm: string, contentType: string): string;
export function finalizePayloadHash(hash: Crypto.Hash): string;
export function calculateTsMac(ts: string, credentials: Client.Credentials): string;
export function timestampMessage(credentials: Client.Credentials, localtimeOffsetMsec: number): TimestampMessage;