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


Java DirectoryString.getInstance方法代码示例

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


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

示例1: getInstance

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
public static NameOrPseudonym getInstance(Object obj)
{
    if (obj == null || obj instanceof NameOrPseudonym)
    {
        return (NameOrPseudonym)obj;
    }

    if (obj instanceof ASN1String)
    {
        return new NameOrPseudonym(DirectoryString.getInstance(obj));
    }

    if (obj instanceof ASN1Sequence)
    {
        return new NameOrPseudonym((ASN1Sequence)obj);
    }

    throw new IllegalArgumentException("illegal object in getInstance: "
        + obj.getClass().getName());
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:NameOrPseudonym.java

示例2: NameOrPseudonym

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

示例3: NameOrPseudonym

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p>
 * The sequence is of type NameOrPseudonym:
 * <pre>
 *       NameOrPseudonym ::= CHOICE {
 *            surAndGivenName SEQUENCE {
 *              surName DirectoryString,
 *              givenName SEQUENCE OF DirectoryString
 *         },
 *            pseudonym DirectoryString
 *       }
 * </pre>
 * </p>
 * @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:ttt43ttt,项目名称:gwt-crypto,代码行数:34,代码来源:NameOrPseudonym.java

示例4: getGivenName

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
public DirectoryString[] getGivenName()
{
    DirectoryString[] items = new DirectoryString[givenName.size()];
    int count = 0;
    for (Enumeration e = givenName.getObjects(); e.hasMoreElements();)
    {
        items[count++] = DirectoryString.getInstance(e.nextElement());
    }
    return items;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:11,代码来源:NameOrPseudonym.java

示例5: PersonalData

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p/>
 * The sequence is of type NameOrPseudonym:
 * <p/>
 * <pre>
 *     PersonalData ::= SEQUENCE {
 *       nameOrPseudonym NameOrPseudonym,
 *       nameDistinguisher [0] INTEGER OPTIONAL,
 *       dateOfBirth [1] GeneralizedTime OPTIONAL,
 *       placeOfBirth [2] DirectoryString OPTIONAL,
 *       gender [3] PrintableString OPTIONAL,
 *       postalAddress [4] DirectoryString OPTIONAL
 *       }
 * </pre>
 *
 * @param seq The ASN.1 sequence.
 */
private PersonalData(ASN1Sequence seq)
{
    if (seq.size() < 1)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    Enumeration e = seq.getObjects();

    nameOrPseudonym = NameOrPseudonym.getInstance(e.nextElement());

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
        int tag = o.getTagNo();
        switch (tag)
        {
            case 0:
                nameDistinguisher = ASN1Integer.getInstance(o, false).getValue();
                break;
            case 1:
                dateOfBirth = ASN1GeneralizedTime.getInstance(o, false);
                break;
            case 2:
                placeOfBirth = DirectoryString.getInstance(o, true);
                break;
            case 3:
                gender = DERPrintableString.getInstance(o, false).getString();
                break;
            case 4:
                postalAddress = DirectoryString.getInstance(o, true);
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:57,代码来源:PersonalData.java

示例6: ProcurationSyntax

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

示例7: getProfessionItems

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
/**
 * @return Returns the professionItems.
 */
public DirectoryString[] getProfessionItems()
{
    DirectoryString[] items = new DirectoryString[professionItems.size()];
    int count = 0;
    for (Enumeration e = professionItems.getObjects(); e.hasMoreElements();)
    {
        items[count++] = DirectoryString.getInstance(e.nextElement());
    }
    return items;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:ProfessionInfo.java

示例8: getInstance

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
public static AdditionalInformationSyntax getInstance(Object obj)
{
    if (obj instanceof AdditionalInformationSyntax)
    {
        return (AdditionalInformationSyntax)obj;
    }

    if (obj != null)
    {
        return new AdditionalInformationSyntax(DirectoryString.getInstance(obj));
    }

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

示例9: getInstance

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
public static Restriction getInstance(Object obj)
{
    if (obj instanceof Restriction)
    {
        return (Restriction)obj;
    }

    if (obj != null)
    {
        return new Restriction(DirectoryString.getInstance(obj));
    }

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

示例10: SignerLocation

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

示例11: PersonalData

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p>
 * The sequence is of type NameOrPseudonym:
 * <pre>
 *     PersonalData ::= SEQUENCE {
 *       nameOrPseudonym NameOrPseudonym,
 *       nameDistinguisher [0] INTEGER OPTIONAL,
 *       dateOfBirth [1] GeneralizedTime OPTIONAL,
 *       placeOfBirth [2] DirectoryString OPTIONAL,
 *       gender [3] PrintableString OPTIONAL,
 *       postalAddress [4] DirectoryString OPTIONAL
 *       }
 * </pre>
 * </p>
 * @param seq The ASN.1 sequence.
 */
private PersonalData(ASN1Sequence seq)
{
    if (seq.size() < 1)
    {
        throw new IllegalArgumentException("Bad sequence size: "
            + seq.size());
    }

    Enumeration e = seq.getObjects();

    nameOrPseudonym = NameOrPseudonym.getInstance(e.nextElement());

    while (e.hasMoreElements())
    {
        ASN1TaggedObject o = ASN1TaggedObject.getInstance(e.nextElement());
        int tag = o.getTagNo();
        switch (tag)
        {
            case 0:
                nameDistinguisher = ASN1Integer.getInstance(o, false).getValue();
                break;
            case 1:
                dateOfBirth = ASN1GeneralizedTime.getInstance(o, false);
                break;
            case 2:
                placeOfBirth = DirectoryString.getInstance(o, true);
                break;
            case 3:
                gender = DERPrintableString.getInstance(o, false).getString();
                break;
            case 4:
                postalAddress = DirectoryString.getInstance(o, true);
                break;
            default:
                throw new IllegalArgumentException("Bad tag number: " + o.getTagNo());
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:56,代码来源:PersonalData.java

示例12: ProcurationSyntax

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
/**
 * Constructor from ASN1Sequence.
 * <p>
 * The sequence is of type ProcurationSyntax:
 * <pre>
 *               ProcurationSyntax ::= SEQUENCE {
 *                 country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
 *                 typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
 *                 signingFor [3] EXPLICIT SigningFor
 *               }
 *
 *               SigningFor ::= CHOICE
 *               {
 *                 thirdPerson GeneralName,
 *                 certRef IssuerSerial
 *               }
 * </pre>
 * </p>
 * @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:ttt43ttt,项目名称:gwt-crypto,代码行数:56,代码来源:ProcurationSyntax.java


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