当前位置: 首页>>代码示例>>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;未经允许,请勿转载。