xrtSshPrivateKeyRead

解析二进制 openssh-key-v1 容器,并预验证全部公开公钥 blob。

xsshcode xrtSshPrivateKeyRead( xbytesview Blob, xsshopensshprivatekey* pPrivateKey );
参数说明
xbytesview Blob二进制数据
xsshopensshprivatekey* pPrivateKeyPrvateKey 参数
返回:解析二进制 openssh-key-v1 容器,并预验证全部公开公钥 blob。

示例已编译验证

/* 解析二进制 openssh-key-v1 容器,并预验证全部公开公钥 blob。 */
result = xrtSshPrivateKeyRead(Blob, pPrivateKey);

xrtSshPrivateKeyIsEncrypted

判断容器是否需要外部 cipher/KDF 层先解密 PrivateList。

xsshcode xrtSshPrivateKeyIsEncrypted( const xsshopensshprivatekey* pPrivateKey, bool* pEncrypted );
参数说明
const xsshopensshprivatekey* pPrivateKeyPrvateKey 参数
bool* pEncryptedEncryted 参数
返回:判断容器是否需要外部 cipher/KDF 层先解密 PrivateList。

示例已编译验证

/* 判断容器是否需要外部 cipher/KDF 层先解密 PrivateList。 */
result = xrtSshPrivateKeyIsEncrypted(pPrivateKey, pEncrypted);

xrtSshPrivateKeyPublicsInit

初始化容器公开公钥游标。

xsshcode xrtSshPrivateKeyPublicsInit( const xsshopensshprivatekey* pPrivateKey, xsshprivatekeypublics* pPublics );
参数说明
const xsshopensshprivatekey* pPrivateKeyPrvateKey 参数
xsshprivatekeypublics* pPublicsPublcs 参数
返回:初始化容器公开公钥游标。

示例已编译验证

sshprivatekeypublicsinit obj;
xrtSshPrivateKeyPublicsInit(&obj, pPrivateKey, pPublics);

xrtSshPrivateKeyPublicsNext

返回下一把公开公钥 blob;遍历完成返回 XSSH_NEED_MORE。

xsshcode xrtSshPrivateKeyPublicsNext( xsshprivatekeypublics* pPublics, xbytesview* pPublicKey );
参数说明
xsshprivatekeypublics* pPublicsPublcs 参数
xbytesview* pPublicKey公钥
返回:返回下一把公开公钥 blob;遍历完成返回 XSSH_NEED_MORE。

示例已编译验证

/* 返回下一把公开公钥 blob;遍历完成返回 XSSH_NEED_MORE。 */
result = xrtSshPrivateKeyPublicsNext(pPublics, pPublicKey);