/// import { WellKnownAuthType } from "./WellKnownAuthType"; declare type AuthMetadata = { type: { identifier: number; string: string; }; payload: Buffer; }; declare type UsernameAndPassword = { username: Buffer; password: Buffer; }; /** * Encode Auth metadata with the given {@link WellKnownAuthType} and auth payload {@link Buffer} * * @param authType well known auth type * @param authPayloadBuffer auth payload buffer * @returns encoded {@link WellKnownAuthType} and payload {@link Buffer} */ export declare function encodeWellKnownAuthMetadata(authType: WellKnownAuthType, authPayloadBuffer: Buffer): Buffer; /** * Encode Auth metadata with the given custom auth type {@link string} and auth payload {@link Buffer} * * @param customAuthType custom auth type * @param authPayloadBuffer auth payload buffer * @returns encoded {@link WellKnownAuthType} and payload {@link Buffer} */ export declare function encodeCustomAuthMetadata(customAuthType: string, authPayloadBuffer: Buffer): Buffer; /** * Encode Simple Auth metadata with the given username and password * * @param username username * @param password password * @returns encoded {@link SIMPLE} and given username and password as auth payload {@link Buffer} */ export declare function encodeSimpleAuthMetadata(username: string | Buffer, password: string | Buffer): Buffer; /** * Encode Bearer Auth metadata with the given token * * @param token token * @returns encoded {@link BEARER} and given token as auth payload {@link Buffer} */ export declare function encodeBearerAuthMetadata(token: string | Buffer): Buffer; /** * Decode auth metadata {@link Buffer} into {@link AuthMetadata} object * * @param metadata auth metadata {@link Buffer} * @returns decoded {@link AuthMetadata} */ export declare function decodeAuthMetadata(metadata: Buffer): AuthMetadata; /** * Read up to 129 bytes from the given metadata in order to get the custom Auth Type * * @param authPayload * @return sliced username and password buffers */ export declare function decodeSimpleAuthPayload(authPayload: Buffer): UsernameAndPassword; export {};