ECDiffieHellman.DeriveKeyTls(ECDiffieHellmanPublicKey, Byte[], Byte[]) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當以衍生類別實作時,會使用 TLS(傳輸層安全)1.1 PRF(Pseudo-Random 函數)執行金鑰推導。
public:
virtual cli::array <System::Byte> ^ DeriveKeyTls(System::Security::Cryptography::ECDiffieHellmanPublicKey ^ otherPartyPublicKey, cli::array <System::Byte> ^ prfLabel, cli::array <System::Byte> ^ prfSeed);
public virtual byte[] DeriveKeyTls(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed);
abstract member DeriveKeyTls : System.Security.Cryptography.ECDiffieHellmanPublicKey * byte[] * byte[] -> byte[]
override this.DeriveKeyTls : System.Security.Cryptography.ECDiffieHellmanPublicKey * byte[] * byte[] -> byte[]
Public Overridable Function DeriveKeyTls (otherPartyPublicKey As ECDiffieHellmanPublicKey, prfLabel As Byte(), prfSeed As Byte()) As Byte()
參數
- otherPartyPublicKey
- ECDiffieHellmanPublicKey
對方的公開金鑰。
- prfLabel
- Byte[]
ASCII 編碼的 PRF 標籤。
- prfSeed
- Byte[]
64 位元組的 PRF 種子。
傳回
從 TLS 1.1 PRF 取得的前 48 位元組,使用共享秘密作為金鑰。
例外狀況
必須有一個衍生類別覆寫此方法。
所 otherPartyPublicKey 使用的曲線大小與此鍵的曲線不同。
otherPartyPublicKey,prfLabel或prfSeed是。null
prfSeed 長度並非精確的 64 位元組。
-或-
所 otherPartyPublicKey 使用的曲線與此鍵的曲線不同。
-或-
此實例僅代表公鑰。
備註
此方法內部執行橢圓曲線 Diffie-Hellman 密鑰一致,產生共享祕密(z)。
此方法的回傳值為 TLS 1.1 PRF(Pseudo-Random 函數)的 48 位元組輸出。 PRF(z, prfLabel, prfSeed)
欲了解更多資訊,請參閱 IETF RFC 4346,第 5 節。