KeyDerivation Class¶
Provides algorithms for performing key derivation.
- Namespace
Microsoft.AspNetCore.Cryptography.KeyDerivation
- Assemblies
- Microsoft.AspNetCore.Cryptography.KeyDerivation
Syntax¶
public class KeyDerivation
-
class
Microsoft.AspNetCore.Cryptography.KeyDerivation.
KeyDerivation
Methods¶
-
Pbkdf2
(System.String, System.Byte[], Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf, System.Int32, System.Int32)¶ Performs key derivation using the PBKDF2 algorithm.
Arguments: - password (System.String) – The password from which to derive the key.
- salt (System.Byte<System.Byte>[]) – The salt to be used during the key derivation process.
- prf (Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf) – The pseudo-random function to be used in the key derivation process.
- iterationCount (System.Int32) – The number of iterations of the pseudo-random function to apply during the key derivation process.
- numBytesRequested (System.Int32) – The desired length (in bytes) of the derived key.
Return type: System.Byte<System.Byte>[]
Returns: The derived key.
public static byte[] Pbkdf2(string password, byte[] salt, KeyDerivationPrf prf, int iterationCount, int numBytesRequested)
-