本文整理汇总了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
}
}
示例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");
}
}
}