當前位置: 首頁>>代碼示例>>Java>>正文


Java GeneralName.getInstance方法代碼示例

本文整理匯總了Java中org.bouncycastle.asn1.x509.GeneralName.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java GeneralName.getInstance方法的具體用法?Java GeneralName.getInstance怎麽用?Java GeneralName.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bouncycastle.asn1.x509.GeneralName的用法示例。


在下文中一共展示了GeneralName.getInstance方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: EncKeyWithID

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private EncKeyWithID(ASN1Sequence seq)
{
    this.privKeyInfo = PrivateKeyInfo.getInstance(seq.getObjectAt(0));

    if (seq.size() > 1)
    {
        if (!(seq.getObjectAt(1) instanceof DERUTF8String))
        {
            this.identifier = GeneralName.getInstance(seq.getObjectAt(1));
        }
        else
        {
            this.identifier = (ASN1Encodable)seq.getObjectAt(1);
        }
    }
    else
    {
        this.identifier = null;
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:21,代碼來源:EncKeyWithID.java

示例2: POPOSigningKeyInput

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private POPOSigningKeyInput(ASN1Sequence seq)
{
    ASN1Encodable authInfo = (ASN1Encodable)seq.getObjectAt(0);

    if (authInfo instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject tagObj = (ASN1TaggedObject)authInfo;
        if (tagObj.getTagNo() != 0)
        {
            throw new IllegalArgumentException(
                "Unknown authInfo tag: " + tagObj.getTagNo());
        }
        sender = GeneralName.getInstance(tagObj.getObject());
    }
    else
    {
        publicKeyMAC = PKMACValue.getInstance(authInfo);
    }

    publicKey = SubjectPublicKeyInfo.getInstance(seq.getObjectAt(1));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:22,代碼來源:POPOSigningKeyInput.java

示例3: SemanticsInformation

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private SemanticsInformation(ASN1Sequence seq)
{
    Enumeration e = seq.getObjects();
    if (seq.size() < 1)
    {
         throw new IllegalArgumentException("no objects in SemanticsInformation");
    }
    
    Object object = e.nextElement();
    if (object instanceof ASN1ObjectIdentifier)
    {
        semanticsIdentifier = ASN1ObjectIdentifier.getInstance(object);
        if (e.hasMoreElements())
        {
            object = e.nextElement();
        }
        else
        {
            object = null;
        }
    }
    
    if (object != null)
    {
        ASN1Sequence generalNameSeq = ASN1Sequence.getInstance(object);
        nameRegistrationAuthorities = new GeneralName[generalNameSeq.size()];
        for (int i= 0; i < generalNameSeq.size(); i++)
        {
            nameRegistrationAuthorities[i] = GeneralName.getInstance(generalNameSeq.getObjectAt(i));
        } 
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:33,代碼來源:SemanticsInformation.java

示例4: ProcurationSyntax

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的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

示例5: SinglePubInfo

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private SinglePubInfo(ASN1Sequence seq)
{
    pubMethod = ASN1Integer.getInstance(seq.getObjectAt(0));

    if (seq.size() == 2)
    {
        pubLocation = GeneralName.getInstance(seq.getObjectAt(1));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:10,代碼來源:SinglePubInfo.java

示例6: DVCSErrorNotice

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private DVCSErrorNotice(ASN1Sequence seq)
{
    this.transactionStatus = PKIStatusInfo.getInstance(seq.getObjectAt(0));
    if (seq.size() > 1)
    {
        this.transactionIdentifier = GeneralName.getInstance(seq.getObjectAt(1));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:9,代碼來源:DVCSErrorNotice.java

示例7: DVCSRequest

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private DVCSRequest(ASN1Sequence seq)
{
    requestInformation = DVCSRequestInformation.getInstance(seq.getObjectAt(0));
    data = Data.getInstance(seq.getObjectAt(1));
    if (seq.size() > 2)
    {
        transactionIdentifier = GeneralName.getInstance(seq.getObjectAt(2));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:10,代碼來源:DVCSRequest.java

示例8: TBSRequest

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private TBSRequest(
    ASN1Sequence    seq)
{
    int    index = 0;

    if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
    {
        ASN1TaggedObject    o = (ASN1TaggedObject)seq.getObjectAt(0);

        if (o.getTagNo() == 0)
        {
            versionSet = true;
            version = ASN1Integer.getInstance((ASN1TaggedObject)seq.getObjectAt(0), true);
            index++;
        }
        else
        {
            version = V1;
        }
    }
    else
    {
        version = V1;
    }

    if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
    {
        requestorName = GeneralName.getInstance((ASN1TaggedObject)seq.getObjectAt(index++), true);
    }
    
    requestList = (ASN1Sequence)seq.getObjectAt(index++);

    if (seq.size() == (index + 1))
    {
        requestExtensions = Extensions.getInstance((ASN1TaggedObject)seq.getObjectAt(index), true);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:38,代碼來源:TBSRequest.java

示例9: getAlternativeNames

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private static Collection getAlternativeNames(byte[] extVal)
    throws CertificateParsingException
{
    if (extVal == null)
    {
        return Collections.EMPTY_LIST;
    }
    try
    {
        Collection temp = new ArrayList();
        Enumeration it = DERSequence.getInstance(fromExtensionValue(extVal)).getObjects();
        while (it.hasMoreElements())
        {
            GeneralName genName = GeneralName.getInstance(it.nextElement());
            List list = new ArrayList();
            list.add(Integers.valueOf(genName.getTagNo()));
            switch (genName.getTagNo())
            {
            case GeneralName.ediPartyName:
            case GeneralName.x400Address:
            case GeneralName.otherName:
                list.add(genName.getName().toASN1Primitive());
                break;
            case GeneralName.directoryName:
                list.add(X500Name.getInstance(genName.getName()).toString());
                break;
            case GeneralName.dNSName:
            case GeneralName.rfc822Name:
            case GeneralName.uniformResourceIdentifier:
                list.add(((ASN1String)genName.getName()).getString());
                break;
            case GeneralName.registeredID:
                list.add(ASN1ObjectIdentifier.getInstance(genName.getName()).getId());
                break;
            case GeneralName.iPAddress:
                list.add(DEROctetString.getInstance(genName.getName()).getOctets());
                break;
            default:
                throw new IOException("Bad tag number: " + genName.getTagNo());
            }

            temp.add(list);
        }
        return Collections.unmodifiableCollection(temp);
    }
    catch (Exception e)
    {
        throw new CertificateParsingException(e.getMessage());
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:51,代碼來源:X509ExtensionUtil.java

示例10: getRequestorName

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
public GeneralName getRequestorName()
{
    return GeneralName.getInstance(req.getTbsRequest().getRequestorName());
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:5,代碼來源:OCSPReq.java

示例11: AdmissionSyntax

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type ProcurationSyntax:
 * <p/>
 * <pre>
 *     AdmissionSyntax ::= SEQUENCE
 *     {
 *       admissionAuthority GeneralName OPTIONAL,
 *       contentsOfAdmissions SEQUENCE OF Admissions
 *     }
 * <p/>
 *     Admissions ::= SEQUENCE
 *     {
 *       admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
 *       namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
 *       professionInfos SEQUENCE OF ProfessionInfo
 *     }
 * <p/>
 *     NamingAuthority ::= SEQUENCE
 *     {
 *       namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
 *       namingAuthorityUrl IA5String OPTIONAL,
 *       namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
 *     }
 * <p/>
 *     ProfessionInfo ::= SEQUENCE
 *     {
 *       namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
 *       professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
 *       professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
 *       registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
 *       addProfessionInfo OCTET STRING OPTIONAL
 *     }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private AdmissionSyntax(ASN1Sequence seq)
{
    switch (seq.size())
    {
    case 1:
        contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(0));
        break;
    case 2:
        admissionAuthority = GeneralName.getInstance(seq.getObjectAt(0));
        contentsOfAdmissions = DERSequence.getInstance(seq.getObjectAt(1));
        break;
    default:
        throw new IllegalArgumentException("Bad sequence size: " + seq.size());
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:54,代碼來源:AdmissionSyntax.java

示例12: CertId

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private CertId(ASN1Sequence seq)
{
    issuer = GeneralName.getInstance(seq.getObjectAt(0));
    serialNumber = ASN1Integer.getInstance(seq.getObjectAt(1));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:6,代碼來源:CertId.java

示例13: TSTInfo

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private TSTInfo(ASN1Sequence seq)
{
    Enumeration e = seq.getObjects();

    // version
    version = ASN1Integer.getInstance(e.nextElement());

    // tsaPolicy
    tsaPolicyId = ASN1ObjectIdentifier.getInstance(e.nextElement());

    // messageImprint
    messageImprint = MessageImprint.getInstance(e.nextElement());

    // serialNumber
    serialNumber = ASN1Integer.getInstance(e.nextElement());

    // genTime
    genTime = ASN1GeneralizedTime.getInstance(e.nextElement());

    // default for ordering
    ordering = ASN1Boolean.getInstance(false);
    
    while (e.hasMoreElements())
    {
        ASN1Object o = (ASN1Object) e.nextElement();

        if (o instanceof ASN1TaggedObject)
        {
            DERTaggedObject tagged = (DERTaggedObject) o;

            switch (tagged.getTagNo())
            {
            case 0:
                tsa = GeneralName.getInstance(tagged, true);
                break;
            case 1:
                extensions = Extensions.getInstance(tagged, false);
                break;
            default:
                throw new IllegalArgumentException("Unknown tag value " + tagged.getTagNo());
            }
        }
        else if (o instanceof ASN1Sequence || o instanceof Accuracy)
        {
            accuracy = Accuracy.getInstance(o);
        }
        else if (o instanceof ASN1Boolean)
        {
            ordering = ASN1Boolean.getInstance(o);
        }
        else if (o instanceof ASN1Integer)
        {
            nonce = ASN1Integer.getInstance(o);
        }

    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:58,代碼來源:TSTInfo.java

示例14: PKIHeader

import org.bouncycastle.asn1.x509.GeneralName; //導入方法依賴的package包/類
private PKIHeader(ASN1Sequence seq)
{
    Enumeration en = seq.getObjects();

    pvno = ASN1Integer.getInstance(en.nextElement());
    sender = GeneralName.getInstance(en.nextElement());
    recipient = GeneralName.getInstance(en.nextElement());

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

        switch (tObj.getTagNo())
        {
        case 0:
            messageTime = DERGeneralizedTime.getInstance(tObj, true);
            break;
        case 1:
            protectionAlg = AlgorithmIdentifier.getInstance(tObj, true);
            break;
        case 2:
            senderKID = ASN1OctetString.getInstance(tObj, true);
            break;
        case 3:
            recipKID = ASN1OctetString.getInstance(tObj, true);
            break;
        case 4:
            transactionID = ASN1OctetString.getInstance(tObj, true);
            break;
        case 5:
            senderNonce = ASN1OctetString.getInstance(tObj, true);
            break;
        case 6:
            recipNonce = ASN1OctetString.getInstance(tObj, true);
            break;
        case 7:
            freeText = PKIFreeText.getInstance(tObj, true);
            break;
        case 8:
            generalInfo = ASN1Sequence.getInstance(tObj, true);
            break;
        default:
            throw new IllegalArgumentException("unknown tag number: " + tObj.getTagNo());
        }
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:47,代碼來源:PKIHeader.java


注:本文中的org.bouncycastle.asn1.x509.GeneralName.getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。