xrtHttpAuthToken68Valid
判断完整 token68;等号只允许末尾填充,谓词不修改线程错误。
| 参数 | 说明 |
|---|---|
| xstrview Text | 文本视图 |
示例已编译验证
/* 判断完整 token68;等号只允许末尾填充,谓词不修改线程错误。 */ result = xrtHttpAuthToken68Valid(Text);
xrtHttpAuthParamNext
读取 auth-param;输出可未对齐,无值或语法错误不推进游标并清空结果。
| 参数 | 说明 |
|---|---|
| xstrview Parameters | 参数列表 |
| size_t* pOffset | 出:偏移 |
| xhttpparam* pParam | 参数 |
示例已编译验证
/* 读取 auth-param;输出可未对齐,无值或语法错误不推进游标并清空结果。 */ result = xrtHttpAuthParamNext(Parameters, pOffset, pParam);
xrtHttpChallengeNext
迭代认证 challenge 列表;游标和结果可未对齐,错误不推进游标。
| 参数 | 说明 |
|---|---|
| xstrview Challenges | 挑战列表 |
| size_t* pOffset | 出:偏移 |
| xhttpauth* pChallenge | 挑战 |
示例已编译验证
/* 迭代认证 challenge 列表;游标和结果可未对齐,错误不推进游标。 */ result = xrtHttpChallengeNext(Challenges, pOffset, pChallenge);
xrtHttpAuthCursorInit
把 challenge 游标重置到字段列表起点;输出可未对齐。
| 参数 | 说明 |
|---|---|
| xhttpauthcursor* pCursor | 游标 |
示例已编译验证
httpauthcursorinit obj; xrtHttpAuthCursorInit(&obj, pCursor);
xrtHttpFieldChallengeNext
跨同名字段迭代 challenge;字段、游标和结果可未对齐,错误不推进游标。
| 参数 | 说明 |
|---|---|
| const xhttpfield* pFields | 字段数组 |
| size_t iCount | 数量 |
| xstrview Name | 名称(xstrview) |
| xhttpauthcursor* pCursor | 游标 |
| xhttpauth* pChallenge | 挑战 |
示例已编译验证
/* 跨同名字段迭代 challenge;字段、游标和结果可未对齐,错误不推进游标。 */ result = xrtHttpFieldChallengeNext(pFields, iCount, Name, pCursor, pChallenge);
xrtHttpAuthParse
严格解析单份凭据;结果可未对齐,失败时清空合法的结果存储。
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
| xhttpauth* pAuth | 认证对象 |
示例已编译验证
/* 严格解析单份凭据;结果可未对齐,失败时清空合法的结果存储。 */ result = xrtHttpAuthParse(Value, pAuth);
xrtHttpAuthWrite
写出 scheme 与可选认证数据;长度可未对齐,结果不附加零字符。
| 参数 | 说明 |
|---|---|
| xstrview Scheme | 协议方案 |
| xstrview Data | 数据内容 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 写出 scheme 与可选认证数据;长度可未对齐,结果不附加零字符。 */ result = xrtHttpAuthWrite(Scheme, Data, pOutput, iCapacity, pSize);
xrtHttpAuthBuild
构建零结尾认证字段值;可选长度可未对齐,返回值由 xrtFree 释放。
| 参数 | 说明 |
|---|---|
| xstrview Scheme | 协议方案 |
| xstrview Data | 数据内容 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 构建零结尾认证字段值;可选长度可未对齐,返回值由 xrtFree 释放。 */ result = xrtHttpAuthBuild(Scheme, Data, pSize);
xrtHttpBasicWrite
按原始 user:password 字节构建 Basic 字段值;长度输出可未对齐。
| 参数 | 说明 |
|---|---|
| xstrview User | 用户名 |
| xstrview Password | 密码 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 按原始 user:password 字节构建 Basic 字段值;长度输出可未对齐。 */ result = xrtHttpBasicWrite(User, Password, pOutput, iCapacity, pSize);
xrtHttpBasicRead
XRT_API bool xrtHttpBasicRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic );
示例已编译验证
/* XRT_API bool xrtHttpBasicRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic ); */ result = xrtHttpBasicRead();
xrtHttpBasicChallengeRead
严格解析 Basic challenge;未知扩展参数被忽略,realm 借用 Output。
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
| xhttpbasicchallenge* pChallenge | 挑战 |
示例已编译验证
/* 严格解析 Basic challenge;未知扩展参数被忽略,realm 借用 Output。 */ result = xrtHttpBasicChallengeRead(Value, pOutput, iCapacity, pSize, pChallenge);
xrtHttpBasicChallengeWrite
写出带 quoted realm 和可选 UTF-8 声明的 Basic challenge;长度可未对齐。
| 参数 | 说明 |
|---|---|
| xstrview Realm | 认证域 |
| bool bUtf8 | bUtf8 参数 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 写出带 quoted realm 和可选 UTF-8 声明的 Basic challenge;长度可未对齐。 */ result = xrtHttpBasicChallengeWrite(Realm, bUtf8, pOutput, iCapacity, pSize);
xrtHttpBearerTokenValid
按 RFC 6750 b64token 规则判断 Bearer token。
| 参数 | 说明 |
|---|---|
| xstrview Token | 令牌 |
示例已编译验证
/* 按 RFC 6750 b64token 规则判断 Bearer token。 */ result = xrtHttpBearerTokenValid(Token);
xrtHttpBearerWrite
校验并写出完整 Bearer 字段值;结果不补零,长度输出可未对齐。
| 参数 | 说明 |
|---|---|
| xstrview Token | 令牌 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 校验并写出完整 Bearer 字段值;结果不补零,长度输出可未对齐。 */ result = xrtHttpBearerWrite(Token, pOutput, iCapacity, pSize);
xrtHttpBearerRead
严格解析完整 Bearer 字段值;结果可未对齐,Token 借用输入。
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
| xstrview* pToken | 令牌 |
示例已编译验证
/* 严格解析完整 Bearer 字段值;结果可未对齐,Token 借用输入。 */ result = xrtHttpBearerRead(Value, pToken);
xrtHttpBearerChallengeRead
XRT_API bool xrtHttpBearerChallengeRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbearerchallenge* pChallenge );
示例已编译验证
/* XRT_API bool xrtHttpBearerChallengeRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbearerchallenge* pChallenge ); */ result = xrtHttpBearerChallengeRead();
xrtHttpBearerChallengeWrite
XRT_API bool xrtHttpBearerChallengeWrite( const xhttpbearerchallenge* pChallenge, void* pOutput, size_t iCapacity, size_t* pSize );
示例已编译验证
/* XRT_API bool xrtHttpBearerChallengeWrite( const xhttpbearerchallenge* pChallenge, void* pOutput, size_t iCapacity, size_t* pSize ); */ result = xrtHttpBearerChallengeWrite();
xrtHttpDigestAlgorithmParse
解析 RFC 7616 算法 token;未知或无效名称返回 UNKNOWN 且不修改错误槽。
| 参数 | 说明 |
|---|---|
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 解析 RFC 7616 算法 token;未知或无效名称返回 UNKNOWN 且不修改错误槽。 */ result = xrtHttpDigestAlgorithmParse(Name);
xrtHttpDigestAlgorithmName
返回算法的规范线路名称;UNKNOWN 返回空视图且不修改错误槽。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
示例已编译验证
/* 返回算法的规范线路名称;UNKNOWN 返回空视图且不修改错误槽。 */ result = xrtHttpDigestAlgorithmName(Algorithm);
xrtHttpDigestSize
返回二进制摘要长度;未知算法返回零。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
示例已编译验证
/* 返回二进制摘要长度;未知算法返回零。 */ result = xrtHttpDigestSize(Algorithm);
xrtHttpDigestAlgorithmSession
判断算法是否是 -sess 变体。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
示例已编译验证
/* 判断算法是否是 -sess 变体。 */ result = xrtHttpDigestAlgorithmSession(Algorithm);
xrtHttpDigestAlgorithmSupported
判断当前裁剪闭包是否包含指定算法的计算后端。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
示例已编译验证
/* 判断当前裁剪闭包是否包含指定算法的计算后端。 */ result = xrtHttpDigestAlgorithmSupported(Algorithm);
xrtHttpDigestQopParse
解析单个 qop token;未知或无效值返回 NONE。
| 参数 | 说明 |
|---|---|
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 解析单个 qop token;未知或无效值返回 NONE。 */ result = xrtHttpDigestQopParse(Name);
xrtHttpDigestQopName
返回 qop 的规范线路名称;NONE 返回空视图。
| 参数 | 说明 |
|---|---|
| xhttpdigestqop Qop | Qo 参数 |
示例已编译验证
/* 返回 qop 的规范线路名称;NONE 返回空视图。 */ result = xrtHttpDigestQopName(Qop);
xrtHttpDigestHash
使用所选 Digest 算法散列任意连续数据,并写出规范小写十六进制。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
| const void* pData | 用户数据 |
| size_t iDataSize | DataSze 参数 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 使用所选 Digest 算法散列任意连续数据,并写出规范小写十六进制。 */ result = xrtHttpDigestHash(Algorithm, pData, iDataSize, pOutput, iCapacity, pSize);
xrtHttpDigestSecret
计算可持久化的 H(username:realm:password);session 算法仍返回基础值。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
| xstrview Username | 用户名 |
| xstrview Realm | 认证域 |
| xstrview Password | 密码 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 计算可持久化的 H(username:realm:password);session 算法仍返回基础值。 */ result = xrtHttpDigestSecret(Algorithm, Username, Realm, Password, pOutput, iCapacity, pSize);
xrtHttpDigestUserHash
计算 RFC 7616 userhash,即 H(username:realm)。
| 参数 | 说明 |
|---|---|
| xhttpdigestalgorithm Algorithm | 算法标识 |
| xstrview Username | 用户名 |
| xstrview Realm | 认证域 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 计算 RFC 7616 userhash,即 H(username:realm)。 */ result = xrtHttpDigestUserHash(Algorithm, Username, Realm, pOutput, iCapacity, pSize);
xrtHttpDigestRequest
计算 Authorization 中的 request-digest;Method 使用请求线路中的原始方法。
| 参数 | 说明 |
|---|---|
| const xhttpdigestproof* pProof | Proof 参数 |
| xstrview Method | HTTP 方法 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 计算 Authorization 中的 request-digest;Method 使用请求线路中的原始方法。 */ result = xrtHttpDigestRequest(pProof, Method, pOutput, iCapacity, pSize);
xrtHttpDigestRspAuth
计算 Authentication-Info 中的 rspauth。
| 参数 | 说明 |
|---|---|
| const xhttpdigestproof* pProof | Proof 参数 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 计算 Authentication-Info 中的 rspauth。 */ result = xrtHttpDigestRspAuth(pProof, pOutput, iCapacity, pSize);
xrtHttpDigestEqual
不修改错误槽地常量时间比较两个大小写不敏感的十六进制摘要。
| 参数 | 说明 |
|---|---|
| xstrview Left | Left 参数 |
| xstrview Right | Rght 参数 |
示例已编译验证
/* 不修改错误槽地常量时间比较两个大小写不敏感的十六进制摘要。 */ result = xrtHttpDigestEqual(Left, Right);
xrtHttpDigestNonceWrite
XRT_API bool xrtHttpDigestNonceWrite( xbytesview Key, xbytesview Context, int64 iIssuedSeconds, const void* pSalt, void* pOutput, size_t iCapacity, size_t* pSize );
示例已编译验证
/* XRT_API bool xrtHttpDigestNonceWrite( xbytesview Key, xbytesview Context, int64 iIssuedSeconds, const void* pSalt, void* pOutput, size_t iCapacity, size_t* pSize ); */ result = xrtHttpDigestNonceWrite();
xrtHttpDigestNonceVerify
XRT_API xhttpdigestnoncecheck xrtHttpDigestNonceVerify( xstrview Nonce, xbytesview Key, xbytesview Context, int64 iNowSeconds, int64 iLifetimeSeconds, int64 iFutureSkewSeconds, int64* pIssuedSeconds );
示例已编译验证
/* XRT_API xhttpdigestnoncecheck xrtHttpDigestNonceVerify( xstrview Nonce, xbytesview Key, xbytesview Context, int64 iNowSeconds, int64 iLifetimeSeconds, int64 iFutureSkewSeconds, int64* pIssuedSeconds ); */ result = xrtHttpDigestNonceVerify();
xrtHttpDigestNonceCreate
使用操作系统安全随机源生成 salt,再构建无状态 nonce。
| 参数 | 说明 |
|---|---|
| xbytesview Key | 键 |
| xbytesview Context | 上下文 |
| int64 iIssuedSeconds | IssuedSeconds 参数 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 使用操作系统安全随机源生成 salt,再构建无状态 nonce。 */ xhandle* h = xrtHttpDigestNonceCreate(Key, Context, iIssuedSeconds, pOutput, iCapacity, pSize);
xrtHttpDigestProofVerify
XRT_API xhttpdigestverifycheck xrtHttpDigestProofVerify( const xhttpdigestverification* pVerification );
示例已编译验证
/* XRT_API xhttpdigestverifycheck xrtHttpDigestProofVerify( const xhttpdigestverification* pVerification ); */ result = xrtHttpDigestProofVerify();
xrtHttpDigestVerify
XRT_API xhttpdigestverifycheck xrtHttpDigestVerify( const xhttpdigestverification* pVerification, xbytesview NonceKey, xbytesview NonceContext, int64 iNowSeconds, int64 iLifetimeSeconds, int64 iFutureSkewSeconds, int64* pIssuedSeconds );
示例已编译验证
/* XRT_API xhttpdigestverifycheck xrtHttpDigestVerify( const xhttpdigestverification* pVerification, xbytesview NonceKey, xbytesview NonceContext, int64 iNowSeconds, int64 iLifetimeSeconds, int64 iFutureSkewSeconds, int64* pIssuedSeconds ); */ result = xrtHttpDigestVerify();
xrtHttpDigestPolicyInit
初始化现代默认策略:SHA-2、auth/auth-int、优先 auth、遵循 userhash。
| 参数 | 说明 |
|---|---|
| xhttpdigestpolicy* pPolicy | 策略 |
示例已编译验证
httpdigestpolicyinit obj; xrtHttpDigestPolicyInit(&obj, pPolicy);
xrtHttpDigestChallengeChoose
XRT_API xhttpdigestchoosecheck xrtHttpDigestChallengeChoose( const xhttpdigestchallenge* pChallenge, const xhttpdigestpolicy* pPolicy, xhttpdigestchoice* pChoice );
示例已编译验证
/* XRT_API xhttpdigestchoosecheck xrtHttpDigestChallengeChoose( const xhttpdigestchallenge* pChallenge, const xhttpdigestpolicy* pPolicy, xhttpdigestchoice* pChoice ); */ result = xrtHttpDigestChallengeChoose();
xrtHttpDigestClientAuth
XRT_API bool xrtHttpDigestClientAuth( const xhttpdigestclientauth* pInput, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pAuth );
示例已编译验证
/* XRT_API bool xrtHttpDigestClientAuth( const xhttpdigestclientauth* pInput, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pAuth ); */ result = xrtHttpDigestClientAuth();
xrtHttpDigestInfoVerify
XRT_API xhttpdigestinfocheck xrtHttpDigestInfoVerify( const xhttpdigestinfoverification* pVerification );
示例已编译验证
/* XRT_API xhttpdigestinfocheck xrtHttpDigestInfoVerify( const xhttpdigestinfoverification* pVerification ); */ result = xrtHttpDigestInfoVerify();
xrtHttpDigestSessionCreate
创建并复制 Digest 客户端状态;首个请求的 nonce-count 为 1。
| 参数 | 说明 |
|---|---|
| const xhttpdigestsessionconfig* pConfig | 配置结构 |
示例已编译验证
/* 创建并复制 Digest 客户端状态;首个请求的 nonce-count 为 1。 */ xhandle* h = xrtHttpDigestSessionCreate();
xrtHttpDigestSessionRetain
增加会话引用;Exchange 会自动持有创建它的会话。
| 参数 | 说明 |
|---|---|
| xhttpdigestsession* pSession | 会话对象 |
示例已编译验证
/* 增加会话引用;Exchange 会自动持有创建它的会话。 */ result = xrtHttpDigestSessionRetain(pSession);
xrtHttpDigestSessionRelease
释放会话引用;空指针是安全空操作。
| 参数 | 说明 |
|---|---|
| xhttpdigestsession* pSession | 会话对象 |
示例已编译验证
xrtHttpDigestSessionRelease(pSession);
xrtHttpDigestSessionUpdate
原子替换 challenge、选择结果与凭据,并把 nonce-count 重置为 1。
| 参数 | 说明 |
|---|---|
| xhttpdigestsession* pSession | 会话对象 |
| const xhttpdigestsessionconfig* pConfig | 配置结构 |
示例已编译验证
/* 原子替换 challenge、选择结果与凭据,并把 nonce-count 重置为 1。 */ result = xrtHttpDigestSessionUpdate(pSession, pConfig);
xrtHttpDigestSessionAuthorize
为一次请求保留唯一 nonce-count;返回对象可跨线程等待乱序响应。
| 参数 | 说明 |
|---|---|
| xhttpdigestsession* pSession | 会话对象 |
| xstrview Method | HTTP 方法 |
| xstrview RequestTarget | RequestTarget 参数 |
| xstrview EntityHash | 实体哈希 |
示例已编译验证
/* 为一次请求保留唯一 nonce-count;返回对象可跨线程等待乱序响应。 */ result = xrtHttpDigestSessionAuthorize(pSession, Method, RequestTarget, EntityHash);
xrtHttpDigestExchangeRetain
增加请求 Exchange 引用。
| 参数 | 说明 |
|---|---|
| xhttpdigestexchange* pExchange | 交换对象 |
示例已编译验证
/* 增加请求 Exchange 引用。 */ result = xrtHttpDigestExchangeRetain(pExchange);
xrtHttpDigestExchangeRelease
释放 Exchange 及其持有的会话、状态和敏感数据。
| 参数 | 说明 |
|---|---|
| xhttpdigestexchange* pExchange | 交换对象 |
示例已编译验证
xrtHttpDigestExchangeRelease(pExchange);
xrtHttpDigestExchangeAuth
返回 Exchange 生命周期内稳定的 Authorization 协议对象。
| 参数 | 说明 |
|---|---|
| const xhttpdigestexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回 Exchange 生命周期内稳定的 Authorization 协议对象。 */ result = xrtHttpDigestExchangeAuth(pExchange);
xrtHttpDigestExchangeProof
返回 Exchange 生命周期内稳定的响应验证 proof。
| 参数 | 说明 |
|---|---|
| const xhttpdigestexchange* pExchange | 交换对象 |
示例已编译验证
/* 返回 Exchange 生命周期内稳定的响应验证 proof。 */ result = xrtHttpDigestExchangeProof(pExchange);
xrtHttpDigestSessionAccept
XRT_API xhttpdigestsessioncheck xrtHttpDigestSessionAccept( xhttpdigestsession* pSession, const xhttpdigestexchange* pExchange, const xhttpdigestinfo* pInfo, xstrview ResponseEntityHash, xstrview NextCnonce );
示例已编译验证
/* XRT_API xhttpdigestsessioncheck xrtHttpDigestSessionAccept( xhttpdigestsession* pSession, const xhttpdigestexchange* pExchange, const xhttpdigestinfo* pInfo, xstrview ResponseEntityHash, xstrview NextCnonce ); */ result = xrtHttpDigestSessionAccept();
xrtHttpDigestReplayConfigInit
初始化适合普通多线程 HTTP 服务的有界默认配置。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplayconfig* pConfig | 配置结构 |
示例已编译验证
httpdigestreplayconfiginit obj; xrtHttpDigestReplayConfigInit(&obj);
xrtHttpDigestReplayKey
从用户名、nonce 和 cnonce 构建无歧义的固定重放键。
| 参数 | 说明 |
|---|---|
| xstrview Username | 用户名 |
| xstrview Nonce | nonce |
| xstrview Cnonce | 客户端 nonce |
| xhttpdigestreplaykey* pKey | 键 |
示例已编译验证
/* 从用户名、nonce 和 cnonce 构建无歧义的固定重放键。 */ result = xrtHttpDigestReplayKey(Username, Nonce, Cnonce, pKey);
xrtHttpDigestReplayCreate
创建并发安全的内置重放表;配置为空时使用默认值。
| 参数 | 说明 |
|---|---|
| const xhttpdigestreplayconfig* pConfig | 配置结构 |
示例已编译验证
/* 创建并发安全的内置重放表;配置为空时使用默认值。 */ xhandle* h = xrtHttpDigestReplayCreate();
xrtHttpDigestReplayDestroy
销毁重放表;空指针是安全空操作,不能与其他操作并发。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
示例已编译验证
xrtHttpDigestReplayDestroy(pReplay);
xrtHttpDigestReplayCheckKey
按预先派生的键原子检查并推进最大 nonce-count。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
| const xhttpdigestreplaykey* pKey | 键 |
| uint32 iNonceCount | NonceCount 参数 |
| int64 iIssuedSeconds | IssuedSeconds 参数 |
| int64 iNowSeconds | NowSeconds 参数 |
示例已编译验证
/* 按预先派生的键原子检查并推进最大 nonce-count。 */ result = xrtHttpDigestReplayCheckKey(pReplay, pKey, iNonceCount, iIssuedSeconds, iNowSeconds);
xrtHttpDigestReplayCheck
派生键并原子检查,适合已经验证 Digest 证明的普通服务端路径。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
| xstrview Username | 用户名 |
| xstrview Nonce | nonce |
| xstrview Cnonce | 客户端 nonce |
| uint32 iNonceCount | NonceCount 参数 |
| int64 iIssuedSeconds | IssuedSeconds 参数 |
| int64 iNowSeconds | NowSeconds 参数 |
示例已编译验证
/* 派生键并原子检查,适合已经验证 Digest 证明的普通服务端路径。 */ result = xrtHttpDigestReplayCheck(pReplay, Username, Nonce, Cnonce, iNonceCount, iIssuedSeconds, iNowSeconds);
xrtHttpDigestReplayPurge
删除指定时间已经超出 nonce 有效期的记录并返回删除数量。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
| int64 iNowSeconds | NowSeconds 参数 |
示例已编译验证
/* 删除指定时间已经超出 nonce 有效期的记录并返回删除数量。 */ result = xrtHttpDigestReplayPurge(pReplay, iNowSeconds);
xrtHttpDigestReplayClear
清空全部重放记录并保留映射、堆和统计计数。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
示例已编译验证
/* 清空全部重放记录并保留映射、堆和统计计数。 */ result = xrtHttpDigestReplayClear(pReplay);
xrtHttpDigestReplayStats
取得当前容量、条目和累计策略结果;输出可位于合法未对齐存储。
| 参数 | 说明 |
|---|---|
| xhttpdigestreplay* pReplay | Relay 参数 |
| xhttpdigestreplaystats* pStats | 出:统计快照 |
示例已编译验证
/* 取得当前容量、条目和累计策略结果;输出可位于合法未对齐存储。 */ result = xrtHttpDigestReplayStats(pReplay, pStats);
xrtHttpDigestChallengeRead
XRT_API bool xrtHttpDigestChallengeRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestchallenge* pChallenge );
示例已编译验证
/* XRT_API bool xrtHttpDigestChallengeRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestchallenge* pChallenge ); */ result = xrtHttpDigestChallengeRead();
xrtHttpDigestChallengeWrite
XRT_API bool xrtHttpDigestChallengeWrite( const xhttpdigestchallenge* pChallenge, void* pOutput, size_t iCapacity, size_t* pSize );
示例已编译验证
/* XRT_API bool xrtHttpDigestChallengeWrite( const xhttpdigestchallenge* pChallenge, void* pOutput, size_t iCapacity, size_t* pSize ); */ result = xrtHttpDigestChallengeWrite();
xrtHttpDigestAuthRead
XRT_API bool xrtHttpDigestAuthRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pDigest );
示例已编译验证
/* XRT_API bool xrtHttpDigestAuthRead( xstrview Value, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pDigest ); */ result = xrtHttpDigestAuthRead();
xrtHttpDigestAuthWrite
按 RFC 7616 的 quoted/token 线路形式规范写出完整 Digest 凭据。
| 参数 | 说明 |
|---|---|
| const xhttpdigestauth* pDigest | 摘要 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 按 RFC 7616 的 quoted/token 线路形式规范写出完整 Digest 凭据。 */ result = xrtHttpDigestAuthWrite(pDigest, pOutput, iCapacity, pSize);
xrtHttpDigestInfoRead
严格解析 Digest Authentication-Info 参数列表;Algorithm 由请求上下文提供。
| 参数 | 说明 |
|---|---|
| xstrview Value | 值 |
| xhttpdigestalgorithm Algorithm | 算法标识 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
| xhttpdigestinfo* pInfo | 上下文信息 |
示例已编译验证
/* 严格解析 Digest Authentication-Info 参数列表;Algorithm 由请求上下文提供。 */ result = xrtHttpDigestInfoRead(Value, Algorithm, pOutput, iCapacity, pSize, pInfo);
xrtHttpDigestInfoWrite
写出 Digest Authentication-Info 参数列表,不添加字段名或冒号。
| 参数 | 说明 |
|---|---|
| const xhttpdigestinfo* pInfo | 上下文信息 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
示例已编译验证
/* 写出 Digest Authentication-Info 参数列表,不添加字段名或冒号。 */ result = xrtHttpDigestInfoWrite(pInfo, pOutput, iCapacity, pSize);