本文整理汇总了C#中KeePassLib.Security.ProtectedBinary.EqualsValue方法的典型用法代码示例。如果您正苦于以下问题:C# ProtectedBinary.EqualsValue方法的具体用法?C# ProtectedBinary.EqualsValue怎么用?C# ProtectedBinary.EqualsValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeePassLib.Security.ProtectedBinary
的用法示例。
在下文中一共展示了ProtectedBinary.EqualsValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BinPoolFind
private string BinPoolFind(ProtectedBinary pb)
{
if(pb == null) { Debug.Assert(false); return null; }
foreach(KeyValuePair<string, ProtectedBinary> kvp in m_dictBinPool)
{
if(pb.EqualsValue(kvp.Value)) return kvp.Key;
}
return null;
}
示例2: TestProtectedMemory
private static void TestProtectedMemory()
{
#if DEBUG
byte[] pbData = Encoding.ASCII.GetBytes("Test Test Test Test");
ProtectedBinary pb = new ProtectedBinary(true, pbData);
if(!pb.IsProtected) throw new SecurityException("ProtectedBinary-1");
byte[] pbDec = pb.ReadData();
if(!MemUtil.ArraysEqual(pbData, pbDec))
throw new SecurityException("ProtectedBinary-2");
if(!pb.IsProtected) throw new SecurityException("ProtectedBinary-3");
byte[] pbData2 = Encoding.ASCII.GetBytes("Test Test Test Test");
byte[] pbData3 = Encoding.ASCII.GetBytes("Test Test Test Test Test");
ProtectedBinary pb2 = new ProtectedBinary(true, pbData2);
ProtectedBinary pb3 = new ProtectedBinary(true, pbData3);
if(!pb.EqualsValue(pb2)) throw new SecurityException("ProtectedBinary-4");
if(pb.EqualsValue(pb3)) throw new SecurityException("ProtectedBinary-5");
if(pb2.EqualsValue(pb3)) throw new SecurityException("ProtectedBinary-6");
#endif
}