ECDiffieHellmanKeyDerivationFunction 枚举

定义

指定密钥派生函数,ECDiffieHellmanCng 类将使用此函数将机密协议转换为密钥材料。Specifies the key derivation function that the ECDiffieHellmanCng class will use to convert secret agreements into key material.

public enum class ECDiffieHellmanKeyDerivationFunction
public enum ECDiffieHellmanKeyDerivationFunction
type ECDiffieHellmanKeyDerivationFunction = 
Public Enum ECDiffieHellmanKeyDerivationFunction
继承
ECDiffieHellmanKeyDerivationFunction

字段

Hash 0

哈希算法用于生成密钥材料。A hash algorithm is used to generate key material. HashAlgorithm 属性指定要使用的算法的名称。The HashAlgorithm property specifies the name of the algorithm to use. 如果未指定算法名称,则将 SHA256 用作默认算法。If the algorithm name is not specified, SHA256 is used as the default algorithm. 此外,可以指定 SecretPrependSecretAppend 属性,但不是必需的。You can also specify the SecretPrepend and SecretAppend properties, but they are not required. 生成的密钥材料的数量等同于指定算法哈希值的大小。The amount of key material that is generated is equivalent to the size of the hash value for the specified algorithm.

Hmac 1

基于散列的消息验证代码 (HMAC) 算法用于生成密钥材料。A Hash-based Message Authentication Code (HMAC) algorithm is used to generate key material. HmacKey 属性指定要使用的密钥。The HmacKey property specifies the key to use. 必须设置此属性或者必须将 UseSecretAgreementAsHmacKey 属性设置为 true;否则使用 CryptographicException 时,会引发 HmacEither this property must be set or the UseSecretAgreementAsHmacKey property must be set to true; otherwise, a CryptographicException is thrown when you use Hmac. 如果同时设置了这两个属性,则将机密协议用作 HMAC 密钥。If both properties are set, the secret agreement is used as the HMAC key. 此外,可以指定 SecretPrependSecretAppend 属性,但不是必需的。You can also specify the SecretPrepend and SecretAppend properties, but they are not required. 生成的密钥材料的数量等同于 HMAC 值的大小。The amount of key material that is generated is equivalent to the size of the HMAC value.

Tls 2

传输层安全 (TLS) 协议用于生成密钥材料。The Transport Layer Security (TLS) protocol is used to generate key material. 必须设置 SeedLabel 属性;否则使用 CryptographicException 时,会引发 TlsThe Seed and Label properties must be set; otherwise, a CryptographicException is thrown when you use Tls. 此值将生成 160 位的密钥材料。This value generates 160 bits of key material.

注解

ECDiffieHellmanKeyDerivationFunction枚举定义将用于将原始机密协议转换为密钥材料的算法类型。The ECDiffieHellmanKeyDerivationFunction enumeration defines the type of algorithm that will be used to transform a raw secret agreement into key material. 机密协议是密钥交换的一部分, 从私钥和另一方的公钥生成的值。The secret agreement is the value that is generated from a private key and the other party's public key, as part of the key exchange. 它是ECDiffieHellmanCng.DeriveKeyMaterial方法生成的密钥材料的种子值。It is the seed value for the key material that is generated by the ECDiffieHellmanCng.DeriveKeyMaterial method.

属性使用此枚举获取ECDiffieHellmanCng类的密钥派生函数。 ECDiffieHellmanCng.KeyDerivationFunctionThe ECDiffieHellmanCng.KeyDerivationFunction property uses this enumeration to get the key derivation function for the ECDiffieHellmanCng class.

适用于