sip.js
Version:
A SIP library for JavaScript
52 lines (51 loc) • 1.52 kB
TypeScript
import { LoggerFactory } from "../log/logger-factory.js";
import { OutgoingRequestMessage } from "./outgoing-request-message.js";
/**
* Digest Authentication.
* @internal
*/
export declare class DigestAuthentication {
stale: boolean | undefined;
private logger;
private ha1;
private username;
private password;
private cnonce;
private nc;
private ncHex;
private response;
private algorithm;
private realm;
private nonce;
private opaque;
private qop;
private method;
private uri;
/**
* Constructor.
* @param loggerFactory - LoggerFactory.
* @param username - Username.
* @param password - Password.
*/
constructor(loggerFactory: LoggerFactory, ha1: string | undefined, username: string | undefined, password: string | undefined);
/**
* Performs Digest authentication given a SIP request and the challenge
* received in a response to that request.
* @param request -
* @param challenge -
* @returns true if credentials were successfully generated, false otherwise.
*/
authenticate(request: OutgoingRequestMessage, challenge: any, body?: string): boolean;
/**
* Return the Proxy-Authorization or WWW-Authorization header value.
*/
toString(): string;
/**
* Generate the 'nc' value as required by Digest in this.ncHex by reading this.nc.
*/
private updateNcHex;
/**
* Generate Digest 'response' value.
*/
private calculateResponse;
}