GenerateDerivedMacParameters() public method

public GenerateDerivedMacParameters ( int keySize ) : ICipherParameters
keySize int
return ICipherParameters
Beispiel #1
0
		private void Run3(int id, char[] password, byte[] salt, int iCount, byte[] result)
		{
			PbeParametersGenerator generator = new Pkcs12ParametersGenerator(new Sha1Digest());

			generator.Init(PbeParametersGenerator.Pkcs12PasswordToBytes(password), salt, iCount);

			ICipherParameters key = generator.GenerateDerivedMacParameters(160);

			if (!Arrays.AreEqual(result, ((KeyParameter) key).GetKey()))
			{
				Fail("id " + id + " Failed");
			}
		}