当前位置: 首页>>代码示例>>Java>>正文


Java NISTObjectIdentifiers.id_sha384方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.nist.NISTObjectIdentifiers.id_sha384方法的典型用法代码示例。如果您正苦于以下问题:Java NISTObjectIdentifiers.id_sha384方法的具体用法?Java NISTObjectIdentifiers.id_sha384怎么用?Java NISTObjectIdentifiers.id_sha384使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.nist.NISTObjectIdentifiers的用法示例。


在下文中一共展示了NISTObjectIdentifiers.id_sha384方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOIDForHashAlgorithm

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public static ASN1ObjectIdentifier getOIDForHashAlgorithm(int hashAlgorithm)
{
    switch (hashAlgorithm)
    {
    case HashAlgorithm.md5:
        return PKCSObjectIdentifiers.md5;
    case HashAlgorithm.sha1:
        return X509ObjectIdentifiers.id_SHA1;
    case HashAlgorithm.sha224:
        return NISTObjectIdentifiers.id_sha224;
    case HashAlgorithm.sha256:
        return NISTObjectIdentifiers.id_sha256;
    case HashAlgorithm.sha384:
        return NISTObjectIdentifiers.id_sha384;
    case HashAlgorithm.sha512:
        return NISTObjectIdentifiers.id_sha512;
    default:
        throw new IllegalArgumentException("unknown HashAlgorithm");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:TlsUtils.java

示例2: getOIDForHashAlgorithm

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public static ASN1ObjectIdentifier getOIDForHashAlgorithm(short hashAlgorithm)
{
    switch (hashAlgorithm)
    {
    case HashAlgorithm.md5:
        return PKCSObjectIdentifiers.md5;
    case HashAlgorithm.sha1:
        return X509ObjectIdentifiers.id_SHA1;
    case HashAlgorithm.sha224:
        return NISTObjectIdentifiers.id_sha224;
    case HashAlgorithm.sha256:
        return NISTObjectIdentifiers.id_sha256;
    case HashAlgorithm.sha384:
        return NISTObjectIdentifiers.id_sha384;
    case HashAlgorithm.sha512:
        return NISTObjectIdentifiers.id_sha512;
    default:
        throw new IllegalArgumentException("unknown HashAlgorithm");
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:21,代码来源:TlsUtils.java

示例3: digestInfoSha384

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
@Test
public void digestInfoSha384() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("SHA-384");
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = NISTObjectIdentifiers.id_sha384;
	DigestInfo digestInfo = new DigestInfo(new AlgorithmIdentifier(hashAlgoId, DERNull.INSTANCE), digest);
	byte[] encodedDigestInfo = digestInfo.getEncoded();
	LOG.debug("Digest Info: " + new String(Hex.encodeHex(encodedDigestInfo)));
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:12,代码来源:DerTest.java

示例4: SHA384

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public SHA384()
{
    super(NISTObjectIdentifiers.id_sha384, new SHA384Digest(), new PKCS1Encoding(new RSABlindedEngine()));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:DigestSignatureSpi.java

示例5: SHA384

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public SHA384()
{
    super(NISTObjectIdentifiers.id_sha384, new SHA384Digest(), new PKCS1Encoding(new NativeRSAEngine()));
}
 
开发者ID:lookout,项目名称:fast-rsa-engine,代码行数:5,代码来源:FastDigestSignatureSpi.java

示例6: SHA384WithRSAEncryption

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public SHA384WithRSAEncryption()
{
    super(NISTObjectIdentifiers.id_sha384, new SHA384Digest(), new PKCS1Encoding(new RSABlindedEngine()));
}
 
开发者ID:StefanoSalsano,项目名称:alien-ofelia-conet-ccnx,代码行数:5,代码来源:JDKDigestSignature.java

示例7: testGenerateWithMetadataAndDifferentAlgorithmIdentifier

import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; //导入方法依赖的package包/类
public void testGenerateWithMetadataAndDifferentAlgorithmIdentifier()
    throws Exception
{
    cmsTimeStampedDataGenerator.setMetaData(true, fileInput, "TXT");

    BcDigestCalculatorProvider calculatorProvider = new BcDigestCalculatorProvider();

    ASN1ObjectIdentifier algIdentifier = NISTObjectIdentifiers.id_sha224;

    DigestCalculator hashCalculator = calculatorProvider.get(new AlgorithmIdentifier(algIdentifier));
    cmsTimeStampedDataGenerator.initialiseMessageImprintDigestCalculator(hashCalculator);
    hashCalculator.getOutputStream().write(baseData);
    hashCalculator.getOutputStream().close();

    byte[] requestData = hashCalculator.getDigest();
    TimeStampToken timeStampToken = createTimeStampToken(requestData, algIdentifier);

    CMSTimeStampedData cmsTimeStampedData = cmsTimeStampedDataGenerator.generate(timeStampToken, baseData);

    for (int i = 0; i < 3; i++) {
        switch (i) {
        case 0:
            algIdentifier =    NISTObjectIdentifiers.id_sha224;
            break;
        case 1:
            algIdentifier =    NISTObjectIdentifiers.id_sha256;
            break;
        case 2:
            algIdentifier =    NISTObjectIdentifiers.id_sha384;
            break;
        case 3:
            algIdentifier =    NISTObjectIdentifiers.id_sha512;
            break;
        }
        hashCalculator = calculatorProvider.get(new AlgorithmIdentifier(algIdentifier));
        byte[] newRequestData = cmsTimeStampedData.calculateNextHash(hashCalculator);
        TimeStampToken newTimeStampToken = createTimeStampToken(newRequestData, algIdentifier);
        cmsTimeStampedData = cmsTimeStampedData.addTimeStamp(newTimeStampToken);
    }
    byte[] timeStampedData = cmsTimeStampedData.getEncoded();

    metadataCheck(timeStampedData);
    metadataParserCheck(timeStampedData);

}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:46,代码来源:CMSTimeStampedDataGeneratorTest.java


注:本文中的org.bouncycastle.asn1.nist.NISTObjectIdentifiers.id_sha384方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。