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


Java DigestInfo.getEncoded方法代码示例

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


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

示例1: derEncode

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
private byte[] derEncode(
    byte[] hash)
    throws IOException
{
    DigestInfo dInfo = new DigestInfo(algId, hash);

    return dInfo.getEncoded(ASN1Encoding.DER);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:9,代码来源:RSADigestSigner.java

示例2: derEncode

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
private byte[] derEncode(
    byte[]  hash)
    throws IOException
{
    if (algId == null)
    {
        // For raw RSA, the DigestInfo must be prepared externally
        return hash;
    }

    DigestInfo dInfo = new DigestInfo(algId, hash);

    return dInfo.getEncoded(ASN1Encoding.DER);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:DigestSignatureSpi.java

示例3: derEncode

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
private byte[] derEncode(byte[] hash) throws IOException {
    if (digestAlgId == null) {
        // For raw RSA, the DigestInfo must be prepared externally
        return hash;
    }

    DigestInfo digestInfo = new DigestInfo(digestAlgId, hash);
    return digestInfo.getEncoded(ASN1Encoding.DER);
}
 
开发者ID:xipki,项目名称:xitk,代码行数:10,代码来源:P11RSADigestSignatureSpi.java

示例4: digestInfoSha256

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoSha256() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = NISTObjectIdentifiers.id_sha256;
	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

示例5: digestInfoSha384

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的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

示例6: digestInfoSha512

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoSha512() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("SHA-512");
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = NISTObjectIdentifiers.id_sha512;
	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

示例7: digestInfoSha224

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoSha224() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("SHA-224", new BouncyCastleProvider());
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = NISTObjectIdentifiers.id_sha224;
	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

示例8: digestInfoRipemd160

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoRipemd160() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("RIPEMD160", new BouncyCastleProvider());
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = X509ObjectIdentifiers.ripemd160;
	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

示例9: digestInfoRipemd128

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoRipemd128() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("RIPEMD128", new BouncyCastleProvider());
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = TeleTrusTObjectIdentifiers.ripemd128;
	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

示例10: digestInfoRipemd256

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
@Test
public void digestInfoRipemd256() throws Exception {
	byte[] message = "hello world".getBytes();
	MessageDigest messageDigest = MessageDigest.getInstance("RIPEMD256", new BouncyCastleProvider());
	byte[] digest = messageDigest.digest(message);
	LOG.debug("Digest: " + new String(Hex.encodeHex(digest)));
	DERObjectIdentifier hashAlgoId = new DERObjectIdentifier("1.3.36.3.2.3");
	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

示例11: derEncode

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
private byte[] derEncode(ASN1ObjectIdentifier oid, byte[] hash) throws IOException
{
    AlgorithmIdentifier algId = new AlgorithmIdentifier(oid, DERNull.INSTANCE);
    DigestInfo dInfo = new DigestInfo(algId, hash);

    return dInfo.getEncoded(ASN1Encoding.DER);
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:8,代码来源:RSATest.java

示例12: derEncode

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
private byte[] derEncode(
    byte[]  hash)
    throws IOException
{
    if (algId == null)
    {
        // For raw RSA, the DigestInfo must be prepared externally
        return hash;
    }

    DigestInfo              dInfo = new DigestInfo(algId, hash);

    return dInfo.getEncoded(ASN1Encodable.DER);
}
 
开发者ID:StefanoSalsano,项目名称:alien-ofelia-conet-ccnx,代码行数:15,代码来源:JDKDigestSignature.java

示例13: encodeDigest

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
public static byte[] encodeDigest(DigestInfo dInfo) throws IOException {
	return dInfo.getEncoded(DER);
}
 
开发者ID:bluecrystalsign,项目名称:signer-source,代码行数:4,代码来源:DerEncoder.java

示例14: encodeDigest

import org.bouncycastle.asn1.x509.DigestInfo; //导入方法依赖的package包/类
public static byte[] encodeDigest(DigestInfo dInfo) throws IOException {
	return dInfo.getEncoded(ASN1Encoding.DER);
}
 
开发者ID:bluecrystalsign,项目名称:signer-source,代码行数:4,代码来源:DerEncoder.java


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