ECDiffieHellman.DeriveKeyFromHash 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用指定的雜湊演算法進行金鑰推導。
多載
| 名稱 | Description |
|---|---|
| DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName) |
使用指定的雜湊演算法進行金鑰推導。 |
| DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[]) |
當實作於衍生類別時,會使用指定的雜湊演算法進行金鑰推導,並可選擇前置或附加資料。 |
DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName)
使用指定的雜湊演算法進行金鑰推導。
public:
cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm);
public byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm);
member this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName -> byte[]
Public Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName) As Byte()
參數
- otherPartyPublicKey
- ECDiffieHellmanPublicKey
對方的公開金鑰。
- hashAlgorithm
- HashAlgorithmName
用來推導金鑰材料的雜湊演算法。
傳回
共享秘密的雜訊。
例外狀況
otherPartyPublicKey 是 null。
備註
此過載會呼叫方法, DeriveKeyFromHash 傳遞 null 前置值與附加值。
適用於
DeriveKeyFromHash(ECDiffieHellmanPublicKey, HashAlgorithmName, Byte[], Byte[])
當實作於衍生類別時,會使用指定的雜湊演算法進行金鑰推導,並可選擇前置或附加資料。
public:
virtual cli::array <System::Byte> ^ DeriveKeyFromHash(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, cli::array <System::Byte> ^ secretPrepend, cli::array <System::Byte> ^ secretAppend);
public virtual byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend);
public virtual byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] secretPrepend, byte[] secretAppend);
abstract member DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
override this.DeriveKeyFromHash : System.Security.Cryptography.ECDiffieHellmanPublicKey * System.Security.Cryptography.HashAlgorithmName * byte[] * byte[] -> byte[]
Public Overridable Function DeriveKeyFromHash (otherPartyPublicKey As ECDiffieHellmanPublicKey, hashAlgorithm As HashAlgorithmName, secretPrepend As Byte(), secretAppend As Byte()) As Byte()
參數
- otherPartyPublicKey
- ECDiffieHellmanPublicKey
對方的公開金鑰。
- hashAlgorithm
- HashAlgorithmName
用來推導金鑰材料的雜湊演算法。
- secretPrepend
- Byte[]
一個在雜湊前為衍生秘密前加上的值。
- secretAppend
- Byte[]
一個在雜湊前附加於衍生秘密的值。
傳回
根據請求,前置或附加資料後,共享秘密的雜湊值。
例外狀況
必須有一個衍生類別覆寫此方法。
otherPartyPublicKey 是 null。
備註
此方法內部執行橢圓曲線 Diffie-Hellman 密鑰一致,產生共享祕密(z)。
此方法的回傳值是使用指定雜湊演算法的 HASH(secretPrepend || z || secretAppend) 結果,其中 || 表示串接。
若 的secretPrependsecretAppend值為 null,則視為空陣列。