共用方式為


DrtCreateDerivedKey 函式 (drt.h)

DrtCreateDerivedKey 函式會建立當DRT使用衍生密鑰安全性提供者時,DrtRegisterKey 可以使用的密鑰。

語法

HRESULT DrtCreateDerivedKey(
  [in]  PCCERT_CONTEXT pLocalCert,
  [out] DRT_DATA       *pKey
);

參數

[in] pLocalCert

鏈結中「本機」部分之憑證的指標。 此鏈結的根必須符合DrtCreateDerivedKeySecurityProviderpRootCert 所指定的根目錄。 此憑證用來產生用來向DRT註冊及證明「金鑰擁有權」的密鑰。

[out] pKey

所建立索引鍵的指標。

傳回值

此函式會在成功時傳回S_OK。 其他可能的值包括:

傳回碼 Description
E_INVALIDARG
  • pLocalCertNULL
  • pKeyNULL
  • DRT_DATA 結構中的 pb 成員為 NULL
  • DRT_DATA 結構中的 cb 成員不等於 32 個字節。
DRT_E_CAPABILITY_MISMATCH
  • 要求的安全性演演算法無法使用, ( 亦然。BCRYPT_SHA256_ALGORITHM或BCRYPT_AES_ALGORITHM) 。
  • BCryptOpenAlgorithmProvider 作業失敗。
  • dwProvType 參數表示憑證提供者沒有 AES 功能。

規格需求

需求
最低支援的用戶端 Windows 7 專業版 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平台 Windows
標頭 drt.h
程式庫 Drtprov.lib
Dll Drt.dll

另請參閱

DrtCreateDerivedKeySecurityProvider

DrtDeleteDerivedKeySecurityProvider

DrtRegisterKey