InMemorySymmetricSecurityKey.GenerateDerivedKey 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用当前密钥的指定加密算法和参数生成派生密钥。
public:
override cli::array <System::Byte> ^ GenerateDerivedKey(System::String ^ algorithm, cli::array <System::Byte> ^ label, cli::array <System::Byte> ^ nonce, int derivedKeyLength, int offset);
public override byte[] GenerateDerivedKey(string algorithm, byte[] label, byte[] nonce, int derivedKeyLength, int offset);
override this.GenerateDerivedKey : string * byte[] * byte[] * int * int -> byte[]
Public Overrides Function GenerateDerivedKey (algorithm As String, label As Byte(), nonce As Byte(), derivedKeyLength As Integer, offset As Integer) As Byte()
参数
- algorithm
- String
一个 URI,表示用于生成派生密钥的加密算法。
- derivedKeyLength
- Int32
派生密钥的大小。
- offset
- Int32
派生键位于从此方法返回的字节数组中的位置。
返回
Byte[]
包含派生密钥的 Byte 数组。
例外
不支持 algorithm。 支持的算法为 Psha1KeyDerivation.
注解
若要将 P-SHA1 指定为加密算法,请使用该 Psha1KeyDerivation 字段。
由于 SHA-1 冲突问题,Microsoft建议基于 SHA-256 或更高版本的安全模型。