本文整理汇总了C#中PasswordDeriveBytes.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# PasswordDeriveBytes.Reset方法的具体用法?C# PasswordDeriveBytes.Reset怎么用?C# PasswordDeriveBytes.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PasswordDeriveBytes
的用法示例。
在下文中一共展示了PasswordDeriveBytes.Reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSaltAfterGetBytes_Reset
public static void SetSaltAfterGetBytes_Reset()
{
using (var deriveBytes = new PasswordDeriveBytes(TestPassword, s_testSalt))
{
deriveBytes.GetBytes(1);
deriveBytes.Reset();
deriveBytes.Salt = s_testSaltB;
Assert.Equal(s_testSaltB, deriveBytes.Salt);
}
}
示例2: GetBytes_StableIfReset
public static void GetBytes_StableIfReset()
{
byte[] first;
byte[] second;
using (var deriveBytes = new PasswordDeriveBytes(TestPassword, s_testSalt))
{
first = deriveBytes.GetBytes(32);
deriveBytes.Reset();
second = deriveBytes.GetBytes(32);
}
Assert.Equal(first, second);
}
示例3: Reset
/// <summary>
/// Reset and ensure same
/// </summary>
private static bool Reset()
{
string password = "pwd";
byte[] salt = new byte[] {0, 1, 2, 3, 4, 5, 6, 7};
PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, salt, "SHA512", 1025);
byte[] res1 = pdb.GetBytes(1025);
pdb.Reset();
byte[] res2 = pdb.GetBytes(1025);
return Util.CompareBytes(res1, res2);
}