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


Java DirectoryString.getString方法代码示例

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


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

示例1: performTest

import org.bouncycastle.asn1.x500.DirectoryString; //导入方法依赖的package包/类
public void performTest()
    throws Exception
{
    DirectoryString res = new DirectoryString("test");
    Restriction restriction = new Restriction(res.getString());

    checkConstruction(restriction, res);

    try
    {
        Restriction.getInstance(new Object());

        fail("getInstance() failed to detect bad object.");
    }
    catch (IllegalArgumentException e)
    {
        // expected
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:20,代码来源:RestrictionUnitTest.java

示例2: 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


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