xrtSshKnownHostLineRead

解析 marker、host patterns、算法、Base64 和注释,不执行信任决策。

xsshcode xrtSshKnownHostLineRead( xstrview Line, xsshknownhostline* pKnownHost );
参数说明
xstrview LineLne 参数
xsshknownhostline* pKnownHostKnownHost 参数
返回:解析 marker、host patterns、算法、Base64 和注释,不执行信任决策。

示例已编译验证

/* 解析 marker、host patterns、算法、Base64 和注释,不执行信任决策。 */
result = xrtSshKnownHostLineRead(Line, pKnownHost);

xrtSshKnownHostLineDecode

解码并验证 known_hosts 行中的算法无关公钥 blob。

xsshcode xrtSshKnownHostLineDecode( const xsshknownhostline* pKnownHost, void* pBlob, size_t iCapacity, xsshpublickey* pPublicKey );
参数说明
const xsshknownhostline* pKnownHostKnownHost 参数
void* pBlob二进制数据
size_t iCapacity容量
xsshpublickey* pPublicKey公钥
返回:解码并验证 known_hosts 行中的算法无关公钥 blob。

示例已编译验证

/* 解码并验证 known_hosts 行中的算法无关公钥 blob。 */
result = xrtSshKnownHostLineDecode(pKnownHost, pBlob, iCapacity, pPublicKey);

xrtSshKnownHostLineKeyMatch

不分配解码缓冲,直接比较 known_hosts 行与完整原始公钥 blob。

xsshcode xrtSshKnownHostLineKeyMatch( const xsshknownhostline* pKnownHost, xbytesview Blob, bool* pMatch );
参数说明
const xsshknownhostline* pKnownHostKnownHost 参数
xbytesview Blob二进制数据
bool* pMatch出:匹配详情
返回:不分配解码缓冲,直接比较 known_hosts 行与完整原始公钥 blob。

示例已编译验证

/* 不分配解码缓冲,直接比较 known_hosts 行与完整原始公钥 blob。 */
result = xrtSshKnownHostLineKeyMatch(pKnownHost, Blob, pMatch);

xrtSshKnownHostPatternsMatch

XRT_API xsshcode xrtSshKnownHostPatternsMatch( xstrview Patterns, xstrview Host, uint32 iPort, xsshknownhostmatch* pMatch );

;
返回:XRT_API xsshcode xrtSshKnownHostPatternsMatch( xstrview Patterns, xstrview Host, uint32 iPort, xsshknownhostmatch* pMatch );

示例已编译验证

/* XRT_API xsshcode xrtSshKnownHostPatternsMatch( xstrview Patterns, xstrview Host, uint32 iPort, xsshknownhostmatch* pMatch ); */
result = xrtSshKnownHostPatternsMatch();

xrtSshKnownHostLineMatch

对已解析行执行明文 host pattern 匹配;hashed 行返回不支持。

xsshcode xrtSshKnownHostLineMatch( const xsshknownhostline* pKnownHost, xstrview Host, uint32 iPort, xsshknownhostmatch* pMatch );
参数说明
const xsshknownhostline* pKnownHostKnownHost 参数
xstrview Host主机名
uint32 iPort端口号
xsshknownhostmatch* pMatch出:匹配详情
返回:对已解析行执行明文 host pattern 匹配;hashed 行返回不支持。

示例已编译验证

/* 对已解析行执行明文 host pattern 匹配;hashed 行返回不支持。 */
result = xrtSshKnownHostLineMatch(pKnownHost, Host, iPort, pMatch);