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


Java ASN1TaggedObject类代码示例

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


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

示例1: KeyAgreeRecipientInfo

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public KeyAgreeRecipientInfo(
    ASN1Sequence seq)
{
    int index = 0;
    
    version = (ASN1Integer)seq.getObjectAt(index++);
    originator = OriginatorIdentifierOrKey.getInstance(
                        (ASN1TaggedObject)seq.getObjectAt(index++), true);

    if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
    {
        ukm = ASN1OctetString.getInstance(
                        (ASN1TaggedObject)seq.getObjectAt(index++), true);
    }

    keyEncryptionAlgorithm = AlgorithmIdentifier.getInstance(
                                            seq.getObjectAt(index++));

    recipientEncryptedKeys = (ASN1Sequence)seq.getObjectAt(index++);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:KeyAgreeRecipientInfo.java

示例2: getCertificate

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
private X509AttributeCertificate getCertificate()
    throws IOException
{
    if (sData != null)
    {
        while (sDataObjectCount < sData.size())
        {
            Object obj = sData.getObjectAt(sDataObjectCount++);

            if (obj instanceof ASN1TaggedObject && ((ASN1TaggedObject)obj).getTagNo() == 2)
            {
               return new X509V2AttributeCertificate(
                      ASN1Sequence.getInstance((ASN1TaggedObject)obj, false).getEncoded());
            }
        }
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:X509AttrCertParser.java

示例3: readDERCertificate

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
private Certificate readDERCertificate(
    InputStream in)
    throws IOException, CertificateParsingException
{
    ASN1InputStream dIn = new ASN1InputStream(in);
    ASN1Sequence seq = (ASN1Sequence)dIn.readObject();

    if (seq.size() > 1
            && seq.getObjectAt(0) instanceof DERObjectIdentifier)
    {
        if (seq.getObjectAt(0).equals(PKCSObjectIdentifiers.signedData))
        {
            sData = new SignedData(ASN1Sequence.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(1), true)).getCertificates();

            return getCertificate();
        }
    }

    return new X509CertificateObject(
                        org.bouncycastle.asn1.x509.Certificate.getInstance(seq));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:23,代码来源:X509CertParser.java

示例4: getObjectInTag

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
private ASN1Primitive getObjectInTag(int tagNo)
{
    Enumeration e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1Encodable obj = (ASN1Encodable)e.nextElement();

        if (obj instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject tag = (ASN1TaggedObject)obj;
            if (tag.getTagNo() == tagNo)
            {
                return tag.getObject().toASN1Primitive();
            }
        }
    }
    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:ECPrivateKey.java

示例5: PrivateKeyInfo

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
/**
 * @deprectaed use PrivateKeyInfo.getInstance()
 * @param seq
 */
public PrivateKeyInfo(
    ASN1Sequence  seq)
{
    Enumeration e = seq.getObjects();

    BigInteger  version = ((ASN1Integer)e.nextElement()).getValue();
    if (version.intValue() != 0)
    {
        throw new IllegalArgumentException("wrong version for private key info");
    }

    algId = AlgorithmIdentifier.getInstance(e.nextElement());
    privKey = ASN1OctetString.getInstance(e.nextElement());
    
    if (e.hasMoreElements())
    {
       attributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:PrivateKeyInfo.java

示例6: ContentInfo

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
/**
 * @deprecated use getInstance()
 */
public ContentInfo(
    ASN1Sequence  seq)
{
    if (seq.size() < 1 || seq.size() > 2)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);

    if (seq.size() > 1)
    {
        ASN1TaggedObject tagged = (ASN1TaggedObject)seq.getObjectAt(1);
        if (!tagged.isExplicit() || tagged.getTagNo() != 0)
        {
            throw new IllegalArgumentException("Bad tag for 'content'");
        }

        content = tagged.getObject();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:25,代码来源:ContentInfo.java

示例7: DistributionPoint

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public DistributionPoint(
    ASN1Sequence seq)
{
    for (int i = 0; i != seq.size(); i++)
    {
        ASN1TaggedObject    t = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
        switch (t.getTagNo())
        {
        case 0:
            distributionPoint = DistributionPointName.getInstance(t, true);
            break;
        case 1:
            reasons = new ReasonFlags(DERBitString.getInstance(t, false));
            break;
        case 2:
            cRLIssuer = GeneralNames.getInstance(t, false);
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:DistributionPoint.java

示例8: getAttributeCertificates

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

示例9: getDigestAlgorithm

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public AlgorithmIdentifier getDigestAlgorithm()
    throws IOException
{
    if (nextObject == null)
    {
        nextObject = seq.readObject();
    }

    if (nextObject instanceof ASN1TaggedObjectParser)
    {
        AlgorithmIdentifier obj = AlgorithmIdentifier.getInstance((ASN1TaggedObject)nextObject.toASN1Primitive(), false);
        nextObject = null;
        return obj;
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:AuthenticatedDataParser.java

示例10: CertStatus

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public CertStatus(
    ASN1TaggedObject    choice)
{
    this.tagNo = choice.getTagNo();

    switch (choice.getTagNo())
    {
    case 0:
        value = DERNull.INSTANCE;
        break;
    case 1:
        value = RevokedInfo.getInstance(choice, false);
        break;
    case 2:
        value = DERNull.INSTANCE;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:CertStatus.java

示例11: RevRepContent

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
private RevRepContent(ASN1Sequence seq)
{
    Enumeration en = seq.getObjects();

    status = ASN1Sequence.getInstance(en.nextElement());
    while (en.hasMoreElements())
    {
        ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(en.nextElement());

        if (tObj.getTagNo() == 0)
        {
            revCerts = ASN1Sequence.getInstance(tObj, true);
        }
        else
        {
            crls = ASN1Sequence.getInstance(tObj, true);
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:RevRepContent.java

示例12: getInstance

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public static X509Extensions getInstance(
    Object  obj)
{
    if (obj == null || obj instanceof X509Extensions)
    {
        return (X509Extensions)obj;
    }

    if (obj instanceof ASN1Sequence)
    {
        return new X509Extensions((ASN1Sequence)obj);
    }

    if (obj instanceof Extensions)
    {
        return new X509Extensions((ASN1Sequence)((Extensions)obj).toASN1Primitive());
    }

    if (obj instanceof ASN1TaggedObject)
    {
        return getInstance(((ASN1TaggedObject)obj).getObject());
    }

    throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:X509Extensions.java

示例13: getInstance

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
public static Holder getInstance(Object obj)
{
    if (obj instanceof Holder)
    {
        return (Holder)obj;
    }
    else if (obj instanceof ASN1TaggedObject)
    {
        return new Holder(ASN1TaggedObject.getInstance(obj));
    }
    else if (obj != null)
    {
        return new Holder(ASN1Sequence.getInstance(obj));
    }

    return null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:Holder.java

示例14: Holder

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
/**
 * Constructor for a holder for an V1 attribute certificate.
 * 
 * @param tagObj The ASN.1 tagged holder object.
 */
private Holder(ASN1TaggedObject tagObj)
{
    switch (tagObj.getTagNo())
    {
    case 0:
        baseCertificateID = IssuerSerial.getInstance(tagObj, false);
        break;
    case 1:
        entityName = GeneralNames.getInstance(tagObj, false);
        break;
    default:
        throw new IllegalArgumentException("unknown tag in Holder");
    }
    version = 0;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:Holder.java

示例15: OOBCertHash

import org.bouncycastle.asn1.ASN1TaggedObject; //导入依赖的package包/类
private OOBCertHash(ASN1Sequence seq)
{
    int index = seq.size() - 1;

    hashVal = DERBitString.getInstance(seq.getObjectAt(index--));

    for (int i = index; i >= 0; i--)
    {
        ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(i);

        if (tObj.getTagNo() == 0)
        {
            hashAlg = AlgorithmIdentifier.getInstance(tObj, true);
        }
        else
        {
            certId = CertId.getInstance(tObj, true);
        }
    }

}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:OOBCertHash.java


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