none
CryptDeriveKey生成的会话密钥导出。 RRS feed

  • 问题

  • CryptDeriveKey函数生成的会话密钥如何导出。我使用CryptExportKey(hKey, NULL, SIMPLEBLOB, 0, keyBuf, &keyLen);导出的时候返回错误。调用GetLastError返回NTE_NO_KEY

    • 已编辑 EastYu 2015年12月21日 5:18
    2015年12月21日 2:33

答案

  • 你好,        

    根据你提供的错误信息,我个人认为CryptExportKey函数第二个参数有问题。这个参数的值不应该为NULL,具体信息可以看这个链接
                    https://msdn.microsoft.com/en-us/library/windows/desktop/aa379931(v=vs.85).aspx

    hExpKey [in]
    A handle to a cryptographic key of the destination user. The key data within the exported key BLOB is encrypted using this key. This ensures that only the destination user is able to make use of the key BLOB. Both hExpKey and hKey must come from the same CSP.

    NTE_NO_KEY
    A session key is being exported, and the hExpKey parameter does not specify a public key

    CryptDeriveKey函数生成的会话密钥如何导出,你可以看一下这个链接:
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa382046(v=vs.85).aspx

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年12月22日 6:54