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


Java CMSObjectIdentifiers类代码示例

本文整理汇总了Java中org.bouncycastle.asn1.cms.CMSObjectIdentifiers的典型用法代码示例。如果您正苦于以下问题:Java CMSObjectIdentifiers类的具体用法?Java CMSObjectIdentifiers怎么用?Java CMSObjectIdentifiers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getOthersFromStore

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos)
{
    List others = new ArrayList();

    for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();)
    {
        ASN1Encodable info = (ASN1Encodable)it.next();

        if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat))
        {
            OCSPResponse resp = OCSPResponse.getInstance(info);

            if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
            {
                throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
            }
        }

        others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info)));
    }

    return others;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:CMSUtils.java

示例2: initialize

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
private void initialize(ContentInfoParser contentInfo)
    throws CMSException
{
    try
    {
        if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType()))
        {
            this.timeStampedData = TimeStampedDataParser.getInstance(contentInfo.getContent(BERTags.SEQUENCE));
        }
        else
        {
            throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId());
        }
    }
    catch (IOException e)
    {
        throw new CMSException("parsing exception: " + e.getMessage(), e);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:CMSTimeStampedDataParser.java

示例3: addBasicOcspRespFrom_id_ri_ocsp_response

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
private void addBasicOcspRespFrom_id_ri_ocsp_response(final List<BasicOCSPResp> basicOCSPResps) {
	final Store otherRevocationInfo = cmsSignedData.getOtherRevocationInfo(CMSObjectIdentifiers.id_ri_ocsp_response);
	final Collection otherRevocationInfoMatches = otherRevocationInfo.getMatches(null);
	for (final Object object : otherRevocationInfoMatches) {
		if (object instanceof DERSequence) {
			final DERSequence otherRevocationInfoMatch = (DERSequence) object;
			final BasicOCSPResp basicOCSPResp;
			if (otherRevocationInfoMatch.size() == 4) {
				basicOCSPResp = CMSUtils.getBasicOcspResp(otherRevocationInfoMatch);
			} else {
				final OCSPResp ocspResp = CMSUtils.getOcspResp(otherRevocationInfoMatch);
				basicOCSPResp = CMSUtils.getBasicOCSPResp(ocspResp);
			}
			addBasicOcspResp(basicOCSPResps, basicOCSPResp);
		} else {
			LOG.warn("Unsupported object type for id_ri_ocsp_response (SHALL be DER encoding) : " + object.getClass().getSimpleName());
		}
	}
}
 
开发者ID:esig,项目名称:dss,代码行数:20,代码来源:CAdESOCSPSource.java

示例4: generate

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * generate an authenticated object that contains an CMS Authenticated Data
 * object using the given provider and the passed in key generator.
 * @deprecated
 */
private CMSAuthenticatedData generate(
    final CMSProcessable  content,
    String          macOID,
    KeyGenerator    keyGen,
    Provider        provider)
    throws NoSuchAlgorithmException, CMSException
{
    Provider                encProvider = keyGen.getProvider();

    convertOldRecipients(rand, provider);

    return generate(new CMSTypedData()
    {
        public ASN1ObjectIdentifier getContentType()
        {
            return CMSObjectIdentifiers.data;
        }

        public void write(OutputStream out)
            throws IOException, CMSException
        {
            content.write(out);
        }

        public Object getContent()
        {
            return content;
        }
    }, new JceCMSMacCalculatorBuilder(new ASN1ObjectIdentifier(macOID)).setProvider(encProvider).setSecureRandom(rand).build());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:36,代码来源:CMSAuthenticatedDataGenerator.java

示例5: open

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * generate a signed object that for a CMS Signed Data
 * object using the given provider - if encapsulate is true a copy
 * of the message will be included in the signature with the
 * default content type "data".
 */
public OutputStream open(
    OutputStream out,
    boolean      encapsulate)
    throws IOException
{
    return open(CMSObjectIdentifiers.data, out, encapsulate);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:CMSSignedDataStreamGenerator.java

示例6: open

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * generate an enveloped object that contains an CMS Enveloped Data
 * object using the given encryptor.
 */
public OutputStream open(
    OutputStream    out,
    OutputEncryptor encryptor)
    throws CMSException, IOException
{
    return doOpen(new ASN1ObjectIdentifier(CMSObjectIdentifiers.data.getId()), out, encryptor);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:CMSEnvelopedDataStreamGenerator.java

示例7: open

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * generate an authenticated data structure with the encapsulated bytes marked as DATA.
 *
 * @param out the stream to store the authenticated structure in.
 * @param macCalculator calculator for the MAC to be attached to the data.
 */
public OutputStream open(
    OutputStream    out,
    MacCalculator   macCalculator)
    throws CMSException
{
    return open(CMSObjectIdentifiers.data, out, macCalculator);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:CMSAuthenticatedDataStreamGenerator.java

示例8: open

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * @deprecated use open(OutputStream, ContentCompressor)
 */
public OutputStream open(
    OutputStream out,
    String       compressionOID) 
    throws IOException
{
    return open(out, CMSObjectIdentifiers.data.getId(), compressionOID);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:CMSCompressedDataStreamGenerator.java

示例9: initialize

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
private void initialize(ContentInfo contentInfo)
{
    this.contentInfo = contentInfo;

    if (CMSObjectIdentifiers.timestampedData.equals(contentInfo.getContentType()))
    {
        this.timeStampedData = TimeStampedData.getInstance(contentInfo.getContent());
    }
    else
    {
        throw new IllegalArgumentException("Malformed content - type must be " + CMSObjectIdentifiers.timestampedData.getId());
    }

    util = new TimeStampDataUtil(this.timeStampedData);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:16,代码来源:CMSTimeStampedData.java

示例10: addTimeStamp

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * Return a new timeStampedData object with the additional token attached.
 *
 * @throws CMSException
 */
public CMSTimeStampedData addTimeStamp(TimeStampToken token)
    throws CMSException
{
    TimeStampAndCRL[] timeStamps = util.getTimeStamps();
    TimeStampAndCRL[] newTimeStamps = new TimeStampAndCRL[timeStamps.length + 1];

    System.arraycopy(timeStamps, 0, newTimeStamps, 0, timeStamps.length);

    newTimeStamps[timeStamps.length] = new TimeStampAndCRL(token.toCMSSignedData().toASN1Structure());

    return new CMSTimeStampedData(new ContentInfo(CMSObjectIdentifiers.timestampedData, new TimeStampedData(timeStampedData.getDataUri(), timeStampedData.getMetaData(), timeStampedData.getContent(), new Evidence(new TimeStampTokenEvidence(newTimeStamps)))));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:CMSTimeStampedData.java

示例11: validateInfoFormat

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
private static void validateInfoFormat(OtherRevocationInfoFormat infoFormat)
{
    if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(infoFormat.getInfoFormat()))
    {
        OCSPResponse resp = OCSPResponse.getInstance(infoFormat.getInfo());

        if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL)
        {
            throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData");
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:13,代码来源:CMSUtils.java

示例12: open

import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; //导入依赖的package包/类
/**
 * Open a compressing output stream.
 *
 * @param contentOID the content type OID.
 * @param out the stream to encode to.
 * @param compressor the type of compressor to use.
 * @return an output stream to write the data be compressed to.
 * @throws IOException
 */
public OutputStream open(
    ASN1ObjectIdentifier contentOID,
    OutputStream out,
    OutputCompressor compressor)
    throws IOException
{
    BERSequenceGenerator sGen = new BERSequenceGenerator(out);

    sGen.addObject(CMSObjectIdentifiers.compressedData);

    //
    // Compressed Data
    //
    BERSequenceGenerator cGen = new BERSequenceGenerator(sGen.getRawOutputStream(), 0, true);

    cGen.addObject(new ASN1Integer(0));

    //
    // AlgorithmIdentifier
    //
    cGen.addObject(compressor.getAlgorithmIdentifier());

    //
    // Encapsulated ContentInfo
    //
    BERSequenceGenerator eiGen = new BERSequenceGenerator(cGen.getRawOutputStream());

    eiGen.addObject(contentOID);

    OutputStream octetStream = CMSUtils.createBEROctetOutputStream(
        eiGen.getRawOutputStream(), 0, true, _bufferSize);

    return new CmsCompressedOutputStream(
        compressor.getOutputStream(octetStream), sGen, cGen, eiGen);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:45,代码来源:CMSCompressedDataStreamGenerator.java


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