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


Java ASN1Set.getObjects方法代码示例

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


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

示例1: getCertificates

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getCertificates(ASN1Set certSet)
{
    if (certSet != null)
    {
        List certList = new ArrayList(certSet.size());

        for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                certList.add(new X509CertificateHolder(Certificate.getInstance(obj)));
            }
        }

        return new CollectionStore(certList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:CMSSignedHelper.java

示例2: getAttributeCertificates

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getAttributeCertificates(ASN1Set certSet)
{
    if (certSet != null)
    {
        List certList = new ArrayList(certSet.size());

        for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1TaggedObject)
            {
                certList.add(new X509AttributeCertificateHolder(AttributeCertificate.getInstance(((ASN1TaggedObject)obj).getObject())));
            }
        }

        return new CollectionStore(certList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:CMSSignedHelper.java

示例3: getCRLs

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getCRLs(ASN1Set crlSet)
{
    if (crlSet != null)
    {
        List crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:CMSSignedHelper.java

示例4: getCertificates

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
 * Return the certificates stored in the underlying OriginatorInfo object.
 *
 * @return a Store of X509CertificateHolder objects.
 */
public Store getCertificates()
{
    ASN1Set certSet = originatorInfo.getCertificates();

    if (certSet != null)
    {
        List certList = new ArrayList(certSet.size());

        for (Enumeration en = certSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                certList.add(new X509CertificateHolder(Certificate.getInstance(obj)));
            }
        }

        return new CollectionStore(certList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:OriginatorInformation.java

示例5: getCRLs

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
 * Return the CRLs stored in the underlying OriginatorInfo object.
 *
 * @return a Store of X509CRLHolder objects.
 */
public Store getCRLs()
{
    ASN1Set crlSet = originatorInfo.getCRLs();

    if (crlSet != null)
    {
        List    crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1Sequence)
            {
                crlList.add(new X509CRLHolder(CertificateList.getInstance(obj)));
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:OriginatorInformation.java

示例6: calculateVersion

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
public static int calculateVersion(OriginatorInfo originatorInfo, ASN1Set recipientInfos, ASN1Set unprotectedAttrs)
{
    int version;

    if (originatorInfo != null || unprotectedAttrs != null)
    {
        version = 2;
    }
    else
    {
        version = 0;

        Enumeration e = recipientInfos.getObjects();

        while (e.hasMoreElements())
        {
            RecipientInfo   ri = RecipientInfo.getInstance(e.nextElement());

            if (ri.getVersion().getValue().intValue() != version)
            {
                version = 2;
                break;
            }
        }
    }

    return version;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:29,代码来源:EnvelopedData.java

示例7: checkForVersion3

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
private boolean checkForVersion3(ASN1Set signerInfs)
{
    for (Enumeration e = signerInfs.getObjects(); e.hasMoreElements();)
    {
        SignerInfo s = SignerInfo.getInstance(e.nextElement());

        if (s.getVersion().getValue().intValue() == 3)
        {
            return true;
        }
    }

    return false;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SignedData.java

示例8: getOtherRevocationInfo

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Set crlSet)
{
    if (crlSet != null)
    {
        List    crlList = new ArrayList(crlSet.size());

        for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();)
        {
            ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive();

            if (obj instanceof ASN1TaggedObject)
            {
                ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(obj);

                if (tObj.getTagNo() == 1)
                {
                    OtherRevocationInfoFormat other = OtherRevocationInfoFormat.getInstance(tObj, false);

                    if (otherRevocationInfoFormat.equals(other.getInfoFormat()))
                    {
                        crlList.add(other.getInfo());
                    }
                }
            }
        }

        return new CollectionStore(crlList);
    }

    return new CollectionStore(new ArrayList());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:32,代码来源:CMSSignedHelper.java

示例9: getCounterSignatures

import org.bouncycastle.asn1.ASN1Set; //导入方法依赖的package包/类
/**
 * Return a SignerInformationStore containing the counter signatures attached to this
 * signer. If no counter signatures are present an empty store is returned.
 */
public SignerInformationStore getCounterSignatures()
{
    // TODO There are several checks implied by the RFC3852 comments that are missing

    /*
    The countersignature attribute MUST be an unsigned attribute; it MUST
    NOT be a signed attribute, an authenticated attribute, an
    unauthenticated attribute, or an unprotected attribute.
    */        
    AttributeTable unsignedAttributeTable = getUnsignedAttributes();
    if (unsignedAttributeTable == null)
    {
        return new SignerInformationStore(new ArrayList(0));
    }

    List counterSignatures = new ArrayList();

    /*
    The UnsignedAttributes syntax is defined as a SET OF Attributes.  The
    UnsignedAttributes in a signerInfo may include multiple instances of
    the countersignature attribute.
    */
    ASN1EncodableVector allCSAttrs = unsignedAttributeTable.getAll(CMSAttributes.counterSignature);

    for (int i = 0; i < allCSAttrs.size(); ++i)
    {
        Attribute counterSignatureAttribute = (Attribute)allCSAttrs.get(i);            

        /*
        A countersignature attribute can have multiple attribute values.  The
        syntax is defined as a SET OF AttributeValue, and there MUST be one
        or more instances of AttributeValue present.
        */
        ASN1Set values = counterSignatureAttribute.getAttrValues();
        if (values.size() < 1)
        {
            // TODO Throw an appropriate exception?
        }

        for (Enumeration en = values.getObjects(); en.hasMoreElements();)
        {
            /*
            Countersignature values have the same meaning as SignerInfo values
            for ordinary signatures, except that:

               1. The signedAttributes field MUST NOT contain a content-type
                  attribute; there is no content type for countersignatures.

               2. The signedAttributes field MUST contain a message-digest
                  attribute if it contains any other attributes.

               3. The input to the message-digesting process is the contents
                  octets of the DER encoding of the signatureValue field of the
                  SignerInfo value with which the attribute is associated.
            */
            SignerInfo si = SignerInfo.getInstance(en.nextElement());

            counterSignatures.add(new SignerInformation(si, null, new CMSProcessableByteArray(getSignature()), null));
        }
    }

    return new SignerInformationStore(counterSignatures);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:68,代码来源:SignerInformation.java


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