共用方式為


GenerateDerivedKey

根據 CardSpace 系統保留的對稱金鑰,產生衍生金鑰。

HRESULT
___stdcall GenerateDerivedKey(
        __in PINFORMATIONCARD_CRYPTO_HANDLE  hCrypto,
    __in DWORD                    cbLabel,
    __in_bcount( cbLabel ) PBYTE  pLabel,
    __in DWORD                    cbNonce,
    __in_bcount( cbNonce ) PBYTE  pNonce,
    __in DWORD                    derivedKeyLength,
    __in DWORD                    offset,
    __in LPCWSTR                  algId,
    __out DWORD*                  pcbKey,
    __out_bcount( *pcbKey ) PBYTE* ppKey );

參數

參數 描述

hCrypto

與先前發行之安全性權杖相關聯的密碼編譯物件控制代碼。

cbLabel

標籤的長度 (以位元組為單位)。

pLabel

標籤。

cbNonce

Nonce 的長度 (以位元組為單位)。

pNonce

Nonce。

derivedKeyLength

所需的衍生金鑰長度。

offset

雜湊位移,雜湊產生自應從中擷取所產生金鑰的標籤和 Nonce。

algId

字串 URI,識別要使用的金鑰衍生演算法。目前只支援 PSHA1 演算法。

pcbKey

衍生金鑰的長度。

ppKey

包含衍生金鑰之緩衝區的指標。使用之後,必須使用 GlobalFree 函式釋放這個緩衝區。

屬性值/傳回值

HRESULT。

需求

Windows Vista

標頭:在 infocard.h 中宣告。

程式庫:使用 infocardapi.lib。

請參閱

概念

傳回的 HRESULT

Footer image

請將您對這個主題的意見傳送至 Microsoft。

Copyright © 2007 by Microsoft Corporation. All rights reserved.