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


Java DERBitString.getInstance方法代码示例

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


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

示例1: ObjectDigestInfo

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
private ObjectDigestInfo(
    ASN1Sequence seq)
{
    if (seq.size() > 4 || seq.size() < 3)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    digestedObjectType = ASN1Enumerated.getInstance(seq.getObjectAt(0));

    int offset = 0;

    if (seq.size() == 4)
    {
        otherObjectTypeID = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(1));
        offset++;
    }

    digestAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1 + offset));

    objectDigest = DERBitString.getInstance(seq.getObjectAt(2 + offset));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:24,代码来源:ObjectDigestInfo.java

示例2: DistributionPoint

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

示例3: X509CertificateStructure

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

    //
    // correct x509 certficate
    //
    if (seq.size() == 3)
    {
        tbsCert = TBSCertificateStructure.getInstance(seq.getObjectAt(0));
        sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));

        sig = DERBitString.getInstance(seq.getObjectAt(2));
    }
    else
    {
        throw new IllegalArgumentException("sequence wrong size for a certificate");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:X509CertificateStructure.java

示例4: IssuerSerial

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
private IssuerSerial(
    ASN1Sequence    seq)
{
    if (seq.size() != 2 && seq.size() != 3)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }
    
    issuer = GeneralNames.getInstance(seq.getObjectAt(0));
    serial = ASN1Integer.getInstance(seq.getObjectAt(1));

    if (seq.size() == 3)
    {
        issuerUID = DERBitString.getInstance(seq.getObjectAt(2));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:IssuerSerial.java

示例5: Certificate

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

    //
    // correct x509 certficate
    //
    if (seq.size() == 3)
    {
        tbsCert = TBSCertificate.getInstance(seq.getObjectAt(0));
        sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));

        sig = DERBitString.getInstance(seq.getObjectAt(2));
    }
    else
    {
        throw new IllegalArgumentException("sequence wrong size for a certificate");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:Certificate.java

示例6: POPOPrivKey

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
private POPOPrivKey(ASN1TaggedObject obj)
{
    this.tagNo = obj.getTagNo();

    switch (tagNo)
    {
    case thisMessage:
        this.obj = DERBitString.getInstance(obj, false);
        break;
    case subsequentMessage:
        this.obj = SubsequentMessage.valueOf(ASN1Integer.getInstance(obj, false).getValue().intValue());
        break;
    case dhMAC:
        this.obj = DERBitString.getInstance(obj, false);
        break;
    case agreeMAC:
        this.obj = PKMACValue.getInstance(obj, false);
        break;
    case encryptedKey:
        this.obj = EnvelopedData.getInstance(obj, false);
        break;
    default:
        throw new IllegalArgumentException("unknown tag in POPOPrivKey");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:POPOPrivKey.java

示例7: POPOSigningKey

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

示例8: OOBCertHash

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

示例9: PKIMessage

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

示例10: PKIStatusInfo

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

    this.statusString = null;
    this.failInfo = null;

    if (seq.size() > 2)
    {
        this.statusString = PKIFreeText.getInstance(seq.getObjectAt(1));
        this.failInfo = DERBitString.getInstance(seq.getObjectAt(2));
    }
    else if (seq.size() > 1)
    {
        Object obj = seq.getObjectAt(1); 
        if (obj instanceof DERBitString)
        {
            this.failInfo = DERBitString.getInstance(obj);
        }
        else
        {
            this.statusString = PKIFreeText.getInstance(obj);
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:27,代码来源:PKIStatusInfo.java

示例11: CertificateList

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
public CertificateList(
    ASN1Sequence seq)
{
    if (seq.size() == 3)
    {
        tbsCertList = TBSCertList.getInstance(seq.getObjectAt(0));
        sigAlgId = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
        sig = DERBitString.getInstance(seq.getObjectAt(2));
    }
    else
    {
        throw new IllegalArgumentException("sequence wrong size for CertificateList");
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:CertificateList.java

示例12: SubjectPublicKeyInfo

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
public SubjectPublicKeyInfo(
    ASN1Sequence  seq)
{
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException("Bad sequence size: "
                + seq.size());
    }

    Enumeration         e = seq.getObjects();

    this.algId = AlgorithmIdentifier.getInstance(e.nextElement());
    this.keyData = DERBitString.getInstance(e.nextElement());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:15,代码来源:SubjectPublicKeyInfo.java

示例13: AttributeCertificateInfo

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
private AttributeCertificateInfo(
    ASN1Sequence   seq)
{
    if (seq.size() < 7 || seq.size() > 9)
    {
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }

    this.version = ASN1Integer.getInstance(seq.getObjectAt(0));
    this.holder = Holder.getInstance(seq.getObjectAt(1));
    this.issuer = AttCertIssuer.getInstance(seq.getObjectAt(2));
    this.signature = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
    this.serialNumber = ASN1Integer.getInstance(seq.getObjectAt(4));
    this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
    this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));
    
    for (int i = 7; i < seq.size(); i++)
    {
        ASN1Encodable    obj = (ASN1Encodable)seq.getObjectAt(i);

        if (obj instanceof DERBitString)
        {
            this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
        }
        else if (obj instanceof ASN1Sequence || obj instanceof Extensions)
        {
            this.extensions = Extensions.getInstance(seq.getObjectAt(i));
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:31,代码来源:AttributeCertificateInfo.java

示例14: AttributeCertificate

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
public AttributeCertificate(
    ASN1Sequence    seq)
{
    if (seq.size() != 3)
    {
        throw new IllegalArgumentException("Bad sequence size: "
                + seq.size());
    }

    this.acinfo = AttributeCertificateInfo.getInstance(seq.getObjectAt(0));
    this.signatureAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
    this.signatureValue = DERBitString.getInstance(seq.getObjectAt(2));
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:AttributeCertificate.java

示例15: getInstance

import org.bouncycastle.asn1.DERBitString; //导入方法依赖的package包/类
public static KeyUsage getInstance(Object obj)   // needs to be DERBitString for other VMs
{
    if (obj instanceof KeyUsage)
    {
        return (KeyUsage)obj;
    }
    else if (obj != null)
    {
        return new KeyUsage(DERBitString.getInstance(obj));
    }

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


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