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


Java ASN1Sequence.getObjectAt方法代码示例

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


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

示例1: NameOrPseudonym

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type NameOrPseudonym:
 * <p/>
 * <pre>
 *       NameOrPseudonym ::= CHOICE {
 *            surAndGivenName SEQUENCE {
 *              surName DirectoryString,
 *              givenName SEQUENCE OF DirectoryString
 *         },
 *            pseudonym DirectoryString
 *       }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private NameOrPseudonym(ASN1Sequence seq)
{
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    if (!(seq.getObjectAt(0) instanceof ASN1String))
    {
        throw new IllegalArgumentException("Bad object encountered: "
            + seq.getObjectAt(0).getClass());
    }

    surname = DirectoryString.getInstance(seq.getObjectAt(0));
    givenName = ASN1Sequence.getInstance(seq.getObjectAt(1));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:35,代码来源:NameOrPseudonym.java

示例2: POPOSigningKey

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private POPOSigningKey(ASN1Sequence seq)
{
    int index = 0;

    if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject tagObj
            = (ASN1TaggedObject)seq.getObjectAt(index++);
        if (tagObj.getTagNo() != 0)
        {
            throw new IllegalArgumentException(
                "Unknown POPOSigningKeyInput tag: " + tagObj.getTagNo());
        }
        poposkInput = POPOSigningKeyInput.getInstance(tagObj.getObject());
    }
    algorithmIdentifier = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++));
    signature = DERBitString.getInstance(seq.getObjectAt(index));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:POPOSigningKey.java

示例3: EncryptedContentInfo

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private EncryptedContentInfo(
    ASN1Sequence seq)
{
    if (seq.size() < 2)
    {
        throw new IllegalArgumentException("Truncated Sequence Found");
    }

    contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
    contentEncryptionAlgorithm = AlgorithmIdentifier.getInstance(
                                                    seq.getObjectAt(1));
    if (seq.size() > 2)
    {
        encryptedContent = ASN1OctetString.getInstance(
                            (ASN1TaggedObject)seq.getObjectAt(2), false);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:EncryptedContentInfo.java

示例4: EnvelopedData

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * @deprecated use getInstance()
 */
public EnvelopedData(
    ASN1Sequence seq)
{
    int     index = 0;
    
    version = (ASN1Integer)seq.getObjectAt(index++);
    
    Object  tmp = seq.getObjectAt(index++);

    if (tmp instanceof ASN1TaggedObject)
    {
        originatorInfo = OriginatorInfo.getInstance((ASN1TaggedObject)tmp, false);
        tmp = seq.getObjectAt(index++);
    }

    recipientInfos = ASN1Set.getInstance(tmp);
    
    encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(index++));
    
    if(seq.size() > index)
    {
        unprotectedAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(index), false);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:28,代码来源:EnvelopedData.java

示例5: CertResponse

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private CertResponse(ASN1Sequence seq)
{
    certReqId = ASN1Integer.getInstance(seq.getObjectAt(0));
    status = PKIStatusInfo.getInstance(seq.getObjectAt(1));

    if (seq.size() >= 3)
    {
        if (seq.size() == 3)
        {
            ASN1Encodable o = seq.getObjectAt(2);
            if (o instanceof ASN1OctetString)
            {
                rspInfo = ASN1OctetString.getInstance(o);
            }
            else
            {
                certifiedKeyPair = CertifiedKeyPair.getInstance(o);
            }
        }
        else
        {
            certifiedKeyPair = CertifiedKeyPair.getInstance(seq.getObjectAt(2));
            rspInfo = ASN1OctetString.getInstance(seq.getObjectAt(3));
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:CertResponse.java

示例6: McElieceCCA2PrivateKey

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private McElieceCCA2PrivateKey(ASN1Sequence seq)
{
    oid = ((ASN1ObjectIdentifier)seq.getObjectAt(0));

    BigInteger bigN = ((ASN1Integer)seq.getObjectAt(1)).getValue();
    n = bigN.intValue();

    BigInteger bigK = ((ASN1Integer)seq.getObjectAt(2)).getValue();
    k = bigK.intValue();

    encField = ((ASN1OctetString)seq.getObjectAt(3)).getOctets();

    encGp = ((ASN1OctetString)seq.getObjectAt(4)).getOctets();

    encP = ((ASN1OctetString)seq.getObjectAt(5)).getOctets();

    encH = ((ASN1OctetString)seq.getObjectAt(6)).getOctets();

    ASN1Sequence asnQInv = (ASN1Sequence)seq.getObjectAt(7);
    encqInv = new byte[asnQInv.size()][];
    for (int i = 0; i < asnQInv.size(); i++)
    {
        encqInv[i] = ((ASN1OctetString)asnQInv.getObjectAt(i)).getOctets();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:McElieceCCA2PrivateKey.java

示例7: OtherRevVals

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private OtherRevVals(ASN1Sequence seq)
{
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }
    this.otherRevValType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
    try
    {
        this.otherRevVals = ASN1Primitive.fromByteArray(seq.getObjectAt(1)
            .toASN1Primitive().getEncoded(ASN1Encoding.DER));
    }
    catch (IOException e)
    {
        throw new IllegalStateException();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:OtherRevVals.java

示例8: TimeStampedData

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private TimeStampedData(ASN1Sequence seq)
{
    this.version = ASN1Integer.getInstance(seq.getObjectAt(0));

    int index = 1;
    if (seq.getObjectAt(index) instanceof DERIA5String)
    {
        this.dataUri = DERIA5String.getInstance(seq.getObjectAt(index++));
    }
    if (seq.getObjectAt(index) instanceof MetaData || seq.getObjectAt(index) instanceof ASN1Sequence)
    {
        this.metaData = MetaData.getInstance(seq.getObjectAt(index++));
    }
    if (seq.getObjectAt(index) instanceof ASN1OctetString)
    {
        this.content = ASN1OctetString.getInstance(seq.getObjectAt(index++));
    }
    this.temporalEvidence = Evidence.getInstance(seq.getObjectAt(index));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:TimeStampedData.java

示例9: GOST3410PublicKeyAlgParameters

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public GOST3410PublicKeyAlgParameters(
    ASN1Sequence  seq)
{
    this.publicKeyParamSet = (ASN1ObjectIdentifier)seq.getObjectAt(0);
    this.digestParamSet = (ASN1ObjectIdentifier)seq.getObjectAt(1);
    
    if (seq.size() > 2)
    {
        this.encryptionParamSet = (ASN1ObjectIdentifier)seq.getObjectAt(2);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:12,代码来源:GOST3410PublicKeyAlgParameters.java

示例10: OtherRecipientInfo

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * @deprecated use getInstance().
 * @param seq
 */
public OtherRecipientInfo(
    ASN1Sequence seq)
{
    oriType = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
    oriValue = seq.getObjectAt(1);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:OtherRecipientInfo.java

示例11: getAttributes

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public X509Attribute[] getAttributes()
{
    ASN1Sequence    seq = cert.getAcinfo().getAttributes();
    X509Attribute[] attrs = new X509Attribute[seq.size()];
    
    for (int i = 0; i != seq.size(); i++)
    {
        attrs[i] = new X509Attribute((ASN1Encodable)seq.getObjectAt(i));
    }
    
    return attrs;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:13,代码来源:X509V2AttributeCertificate.java

示例12: CompressedData

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private CompressedData(
    ASN1Sequence seq)
{
    this.version = (ASN1Integer)seq.getObjectAt(0);
    this.compressionAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    this.encapContentInfo = ContentInfo.getInstance(seq.getObjectAt(2));

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

示例13: SCVPReqRes

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private SCVPReqRes(
    ASN1Sequence seq)
{
    if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
    {
        this.request = ContentInfo.getInstance(ASN1TaggedObject.getInstance(seq.getObjectAt(0)), true);
        this.response = ContentInfo.getInstance(seq.getObjectAt(1));
    }
    else
    {
        this.request = null;
        this.response = ContentInfo.getInstance(seq.getObjectAt(0));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SCVPReqRes.java

示例14: PolicyQualifierInfo

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * Creates a new <code>PolicyQualifierInfo</code> instance.
 *
 * @param as <code>PolicyQualifierInfo</code> X509 structure
 * encoded as an ASN1Sequence. 
 */
public PolicyQualifierInfo(
    ASN1Sequence as)
{
     if (as.size() != 2)
     {
         throw new IllegalArgumentException("Bad sequence size: "
                 + as.size());
     }

     policyQualifierId = ASN1ObjectIdentifier.getInstance(as.getObjectAt(0));
     qualifier = as.getObjectAt(1);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:PolicyQualifierInfo.java

示例15: IssuerAndSerialNumber

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * @deprecated  use getInstance() method.
 * @param seq
 */
public IssuerAndSerialNumber(
    ASN1Sequence    seq)
{
    this.name = X500Name.getInstance(seq.getObjectAt(0));
    this.serialNumber = (ASN1Integer)seq.getObjectAt(1);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:IssuerAndSerialNumber.java


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