當前位置: 首頁>>代碼示例>>Java>>正文


Java ShortenedDigest類代碼示例

本文整理匯總了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 
    }
}
 
開發者ID:ttt43ttt,項目名稱:gwt-crypto,代碼行數:18,代碼來源:MGF1GeneratorTest.java

示例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 
    }
}
 
開發者ID:ttt43ttt,項目名稱:gwt-crypto,代碼行數:18,代碼來源:KDF1GeneratorTest.java

示例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 
    }
}
 
開發者ID:ttt43ttt,項目名稱:gwt-crypto,代碼行數:21,代碼來源:KDF2GeneratorTest.java


注:本文中的org.bouncycastle.crypto.digests.ShortenedDigest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。