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


Java ASN1Sequence.getObjects方法代码示例

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


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

示例1: AuthorityKeyIdentifier

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
protected AuthorityKeyIdentifier(
    ASN1Sequence   seq)
{
    Enumeration     e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = DERTaggedObject.getInstance(e.nextElement());

        switch (o.getTagNo())
        {
        case 0:
            this.keyidentifier = ASN1OctetString.getInstance(o, false);
            break;
        case 1:
            this.certissuer = GeneralNames.getInstance(o, false);
            break;
        case 2:
            this.certserno = ASN1Integer.getInstance(o, false);
            break;
        default:
            throw new IllegalArgumentException("illegal tag");
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:AuthorityKeyIdentifier.java

示例2: PKIMessage

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

    header = PKIHeader.getInstance(en.nextElement());
    body = PKIBody.getInstance(en.nextElement());

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

        if (tObj.getTagNo() == 0)
        {
            protection = DERBitString.getInstance(tObj, true);
        }
        else
        {
            extraCerts = ASN1Sequence.getInstance(tObj, true);
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:22,代码来源:PKIMessage.java

示例3: parseDG1

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private void parseDG1(byte[] DG1) {
    try (ASN1InputStream bIn = new ASN1InputStream(DG1)) {

        org.bouncycastle.asn1.DERApplicationSpecific app = (DERApplicationSpecific) bIn.readObject();

        ASN1Sequence seq = (ASN1Sequence) app.getObject(BERTags.SEQUENCE);
        Enumeration secEnum = seq.getObjects();
        while (secEnum.hasMoreElements()) {
            ASN1Primitive seqObj = (ASN1Primitive) secEnum.nextElement();
            byte[] data = seqObj.getEncoded();
            if (data[0]== 0x41) {
                Log.d("type approval number", ByteUtils.bytesToHex(data));
                this.set5F01(Bytes.allButFirst(data, 1));
            } else if (data[0] == 0x42) {
                byte[] input = Arrays.copyOfRange(data, 3, data.length);
                parse5F02(input);
            } else if (data[0] == 0x7F) {
                parse7F63(data);
            }
        }
    } catch (IOException e) {
        Log.e(getClass().getName(), e.getMessage(), e);
    }
}
 
开发者ID:mDL-ILP,项目名称:mDL-ILP,代码行数:25,代码来源:DrivingLicence.java

示例4: CrlID

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private CrlID(
    ASN1Sequence    seq)
{
    Enumeration    e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1TaggedObject    o = (ASN1TaggedObject)e.nextElement();

        switch (o.getTagNo())
        {
        case 0:
            crlUrl = DERIA5String.getInstance(o, true);
            break;
        case 1:
            crlNum = ASN1Integer.getInstance(o, true);
            break;
        case 2:
            crlTime = DERGeneralizedTime.getInstance(o, true);
            break;
        default:
            throw new IllegalArgumentException(
                    "unknown tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:CrlID.java

示例5: parseDG11

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private void parseDG11(byte[] DG11) {
    try (ASN1InputStream bIn = new ASN1InputStream(DG11)) {
        DERApplicationSpecific app = (DERApplicationSpecific) bIn.readObject();

        ASN1Sequence seq = (ASN1Sequence) app.getObject(BERTags.SEQUENCE);
        Enumeration secEnum = seq.getObjects();
        while (secEnum.hasMoreElements()) {
            ASN1Primitive seqObj = (ASN1Primitive) secEnum.nextElement();
            byte[] data = seqObj.getEncoded();
            if (data[0]== 0x7F) {
                parseDG11(data);
            } else if (data[0] == (byte) 0x80) {
                this.setBSN(Arrays.copyOfRange(data, 2, data.length));
            }
        }
    } catch (IOException e) {
        Log.e(getClass().getName(), e.getMessage(), e);
    }
}
 
开发者ID:mDL-ILP,项目名称:mDL-ILP,代码行数:20,代码来源:DrivingLicence.java

示例6: ExtendedKeyUsage

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

    Enumeration e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1Encodable o = (ASN1Encodable)e.nextElement();
        if (!(o.toASN1Primitive() instanceof ASN1ObjectIdentifier))
        {
            throw new IllegalArgumentException("Only ASN1ObjectIdentifiers allowed in ExtendedKeyUsage.");
        }
        this.usageTable.put(o, o);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:ExtendedKeyUsage.java

示例7: KeyRecRepContent

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

    status = PKIStatusInfo.getInstance(en.nextElement());

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

        switch (tObj.getTagNo())
        {
        case 0:
            newSigCert = CMPCertificate.getInstance(tObj.getObject());
            break;
        case 1:
            caCerts = ASN1Sequence.getInstance(tObj.getObject());
            break;
        case 2:
            keyPairHist = ASN1Sequence.getInstance(tObj.getObject());
            break;
        default:
            throw new IllegalArgumentException("unknown tag number: " + tObj.getTagNo());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:KeyRecRepContent.java

示例8: RSAPrivateKey

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private RSAPrivateKey(
    ASN1Sequence seq)
{
    Enumeration e = seq.getObjects();

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

    version = v;
    modulus = ((ASN1Integer)e.nextElement()).getValue();
    publicExponent = ((ASN1Integer)e.nextElement()).getValue();
    privateExponent = ((ASN1Integer)e.nextElement()).getValue();
    prime1 = ((ASN1Integer)e.nextElement()).getValue();
    prime2 = ((ASN1Integer)e.nextElement()).getValue();
    exponent1 = ((ASN1Integer)e.nextElement()).getValue();
    exponent2 = ((ASN1Integer)e.nextElement()).getValue();
    coefficient = ((ASN1Integer)e.nextElement()).getValue();
    
    if (e.hasMoreElements())
    {
        otherPrimeInfos = (ASN1Sequence)e.nextElement();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:RSAPrivateKey.java

示例9: SignerLocation

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private SignerLocation(
    ASN1Sequence seq)
{
    Enumeration     e = seq.getObjects();

    while (e.hasMoreElements())
    {
        DERTaggedObject o = (DERTaggedObject)e.nextElement();

        switch (o.getTagNo())
        {
        case 0:
            DirectoryString countryNameDirectoryString = DirectoryString.getInstance(o, true);
            this.countryName = new DERUTF8String(countryNameDirectoryString.getString());
            break;
        case 1:
            DirectoryString localityNameDirectoryString = DirectoryString.getInstance(o, true);
            this.localityName = new DERUTF8String(localityNameDirectoryString.getString());
            break;
        case 2:
            if (o.isExplicit())
            {
                this.postalAddress = ASN1Sequence.getInstance(o, true);
            }
            else    // handle erroneous implicitly tagged sequences
            {
                this.postalAddress = ASN1Sequence.getInstance(o, false);
            }
            if (postalAddress != null && postalAddress.size() > 6)
            {
                throw new IllegalArgumentException("postal address must contain less than 6 strings");
            }
            break;
        default:
            throw new IllegalArgumentException("illegal tag");
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:39,代码来源:SignerLocation.java

示例10: GOST3410ParamSetParameters

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
public GOST3410ParamSetParameters(
    ASN1Sequence  seq)
{
    Enumeration     e = seq.getObjects();

    keySize = ((ASN1Integer)e.nextElement()).getValue().intValue();
    p = (ASN1Integer)e.nextElement();
    q = (ASN1Integer)e.nextElement();
    a = (ASN1Integer)e.nextElement();
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:GOST3410ParamSetParameters.java

示例11: QCStatement

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private QCStatement(
    ASN1Sequence seq)
{
    Enumeration e = seq.getObjects();

    // qcStatementId
    qcStatementId = ASN1ObjectIdentifier.getInstance(e.nextElement());
    // qcstatementInfo
    if (e.hasMoreElements())
    {
        qcStatementInfo = (ASN1Encodable) e.nextElement();
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:QCStatement.java

示例12: TimeStampResp

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private TimeStampResp(ASN1Sequence seq)
{

    Enumeration e = seq.getObjects();

    // status
    pkiStatusInfo = PKIStatusInfo.getInstance(e.nextElement());

    if (e.hasMoreElements())
    {
        timeStampToken = ContentInfo.getInstance(e.nextElement());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:TimeStampResp.java

示例13: X500Name

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
private X500Name(
    X500NameStyle style,
    ASN1Sequence  seq)
{
    this.style = style;
    this.rdns = new RDN[seq.size()];

    int index = 0;

    for (Enumeration e = seq.getObjects(); e.hasMoreElements();)
    {
        rdns[index++] = RDN.getInstance(e.nextElement());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:X500Name.java

示例14: getQualifierSet

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
protected static final Set getQualifierSet(ASN1Sequence qualifiers)
    throws CertPathValidatorException
{
    Set pq = new HashSet();

    if (qualifiers == null)
    {
        return pq;
    }

    ByteArrayOutputStream bOut = new ByteArrayOutputStream();
    ASN1OutputStream aOut = new ASN1OutputStream(bOut);

    Enumeration e = qualifiers.getObjects();

    while (e.hasMoreElements())
    {
        try
        {
            aOut.writeObject((ASN1Encodable)e.nextElement());

            pq.add(new PolicyQualifierInfo(bOut.toByteArray()));
        }
        catch (IOException ex)
        {
            throw new ExtCertPathValidatorException("Policy qualifier info cannot be decoded.", ex);
        }

        bOut.reset();
    }

    return pq;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:34,代码来源:CertPathValidatorUtilities.java

示例15: ProcurationSyntax

import org.bouncycastle.asn1.ASN1Sequence; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type ProcurationSyntax:
 * <p/>
 * <pre>
 *               ProcurationSyntax ::= SEQUENCE {
 *                 country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
 *                 typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
 *                 signingFor [3] EXPLICIT SigningFor
 *               }
 * <p/>
 *               SigningFor ::= CHOICE
 *               {
 *                 thirdPerson GeneralName,
 *                 certRef IssuerSerial
 *               }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private ProcurationSyntax(ASN1Sequence seq)
{
    if (seq.size() < 1 || seq.size() > 3)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }
    Enumeration e = seq.getObjects();

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
        switch (o.getTagNo())
        {
            case 1:
                country = DERPrintableString.getInstance(o, true).getString();
                break;
            case 2:
                typeOfSubstitution = DirectoryString.getInstance(o, true);
                break;
            case 3:
                ASN1Encodable signingFor = o.getObject();
                if (signingFor instanceof ASN1TaggedObject)
                {
                    thirdPerson = GeneralName.getInstance(signingFor);
                }
                else
                {
                    certRef = IssuerSerial.getInstance(signingFor);
                }
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:57,代码来源:ProcurationSyntax.java


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