UNPKG

1.13 kBTypeScriptView Raw
1import * as Crypto from 'crypto';
2import * as Client from './client';
3
4export interface Artifacts {
5 app?: string | undefined;
6 dlg?: string | undefined;
7 ext?: string | undefined;
8 hash?: string | undefined;
9 host: string;
10 method: string;
11 nonce: string;
12 port: number;
13 resource: string;
14 ts: string;
15}
16
17export interface TimestampMessage {
18 ts: number;
19 tsm: string;
20}
21
22export const headerVersion: string;
23
24export const algorithms: string[];
25
26export function calculateMac(type: string, credentials: Client.Credentials, options: Artifacts): string;
27
28export function generateNormalizedString(type: string, options: Artifacts): string;
29
30export function calculatePayloadHash(payload: string, algorithm: string, contentType: string): string;
31
32export function initializePayloadHash(algorithm: string, contentType: string): string;
33
34export function finalizePayloadHash(hash: Crypto.Hash): string;
35
36export function calculateTsMac(ts: string, credentials: Client.Credentials): string;
37
38export function timestampMessage(credentials: Client.Credentials, localtimeOffsetMsec: number): TimestampMessage;