當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。