2using System.Collections.Generic;
12 private readonly
byte[] salt;
13 private readonly
byte[] key;
14 private readonly
int iterations;
27 throw new ArgumentException(
"Must be postitive.", nameof(Iterations));
30 throw new ArgumentException(
"Must be postitive.", nameof(Iterations));
32 this.iterations = Iterations;
38 while (--Iterations >= 0)
41 if (KeyLength > Bin.Length)
42 throw new ArgumentException(
"Derived key too long.", nameof(KeyLength));
44 this.key =
new byte[KeyLength];
46 Array.Copy(Bin, 0, this.key, 0, KeyLength);
Contains methods for simple hash calculations.
static byte[] ComputeHash(HashFunction Function, byte[] Data)
Computes a hash of a block of binary data.
Abstract base class for password-based encryption algorithms
Implements the PBKDF1 key derivation function, as defined in §5.1, RFC 2898 (PKCS#5).
Pbkdf1(string Password, int Iterations, int KeyLength, HashFunction HashFunction)
Implements the PBKDF1 key derivation function, as defined in §5.1, RFC 2898 (PKCS#5).
Encodes certificates and keys into PKCS#12 or PFX files.
static byte[] GetRandomBytes(int NrBytes)
Gets a number of random bytes.
Contains static functions used by different algorithms.
static byte[] CONCAT(params byte[][] OctetStrings)
Concatenates a series of octet strings.
HashFunction
Hash method enumeration.