本文整理匯總了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
}
}