本文整理汇总了Java中org.bouncycastle.crypto.digests.ShortenedDigest类的典型用法代码示例。如果您正苦于以下问题:Java ShortenedDigest类的具体用法?Java ShortenedDigest怎么用?Java ShortenedDigest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShortenedDigest类属于org.bouncycastle.crypto.digests包,在下文中一共展示了ShortenedDigest类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performTest
import org.bouncycastle.crypto.digests.ShortenedDigest; //导入依赖的package包/类
public void performTest()
{
checkMask(1, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
checkMask(2, new MGF1BytesGenerator(new SHA1Digest()), seed2, mask2);
checkMask(3, new MGF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);
try
{
new MGF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);
fail("short input array not caught");
}
catch (DataLengthException e)
{
// expected
}
}
示例2: performTest
import org.bouncycastle.crypto.digests.ShortenedDigest; //导入依赖的package包/类
public void performTest()
{
checkMask(1, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
checkMask(2, new KDF1BytesGenerator(new SHA1Digest()), seed2, mask2);
checkMask(3, new KDF1BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed3, mask3);
try
{
new KDF1BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);
fail("short input array not caught");
}
catch (DataLengthException e)
{
// expected
}
}
示例3: performTest
import org.bouncycastle.crypto.digests.ShortenedDigest; //导入依赖的package包/类
public void performTest()
{
checkMask(1, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed1, mask1);
checkMask(2, new KDF2BytesGenerator(new ShortenedDigest(new SHA256Digest(), 20)), seed2, mask2);
checkMask(3, new KDF2BytesGenerator(new SHA256Digest()), seed2, adjustedMask2);
checkMask(4, new KDF2BytesGenerator(new SHA1Digest()), seed2, sha1Mask);
checkMask(5, new KDF2BytesGenerator(new SHA1Digest()), seed3, mask3);
checkMask(6, new KDF2BytesGenerator(new SHA1Digest()), seed4, mask4);
try
{
new KDF2BytesGenerator(new SHA1Digest()).generateBytes(new byte[10], 0, 20);
fail("short input array not caught");
}
catch (DataLengthException e)
{
// expected
}
}