本文整理汇总了Java中org.apache.ws.security.components.crypto.X509NameTokenizer类的典型用法代码示例。如果您正苦于以下问题:Java X509NameTokenizer类的具体用法?Java X509NameTokenizer怎么用?Java X509NameTokenizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
X509NameTokenizer类属于org.apache.ws.security.components.crypto包,在下文中一共展示了X509NameTokenizer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: splitAndTrim
import org.apache.ws.security.components.crypto.X509NameTokenizer; //导入依赖的package包/类
private Vector splitAndTrim(String inString) {
X509NameTokenizer nmTokens = new X509NameTokenizer(inString);
Vector vr = new Vector();
while (nmTokens.hasMoreTokens()) {
vr.add(nmTokens.nextToken());
}
java.util.Collections.sort(vr);
return vr;
}
示例2: checkEmpty
import org.apache.ws.security.components.crypto.X509NameTokenizer; //导入依赖的package包/类
private void
checkEmpty(
final X509NameTokenizer tokenizer
) {
checkTokenizer(
tokenizer, new String[0]
);
}
示例3: checkTokenizer
import org.apache.ws.security.components.crypto.X509NameTokenizer; //导入依赖的package包/类
private void
checkTokenizer(
final X509NameTokenizer tokenizer,
final String[] expected
) {
for (int i = 0; i < expected.length; ++i) {
assertTrue(tokenizer.hasMoreTokens());
assertEquals(tokenizer.nextToken(), expected[i]);
}
assertTrue(!tokenizer.hasMoreTokens());
assertEquals(tokenizer.nextToken(), "");
}
示例4: testEmptyX509NameTokenizer
import org.apache.ws.security.components.crypto.X509NameTokenizer; //导入依赖的package包/类
public void
testEmptyX509NameTokenizer() {
checkEmpty(new X509NameTokenizer(""));
checkEmpty(new X509NameTokenizer(" "));
checkEmpty(new X509NameTokenizer(" \t \n \r\n"));
}
示例5: testWellFormedX509NameTokenizer
import org.apache.ws.security.components.crypto.X509NameTokenizer; //导入依赖的package包/类
public void
testWellFormedX509NameTokenizer() {
checkTokenizer(
new X509NameTokenizer("foo"),
new String[] { "foo" }
);
checkTokenizer(
new X509NameTokenizer(" foo "),
new String[] { "foo" }
);
checkTokenizer(
new X509NameTokenizer(" foo, "),
new String[] { "foo", "" }
);
checkTokenizer(
new X509NameTokenizer(" foo\\, "),
new String[] { "foo\\,"}
);
checkTokenizer(
new X509NameTokenizer(" foo\\, bar "),
new String[] { "foo\\, bar"}
);
checkTokenizer(
new X509NameTokenizer(" \"foo,\" "),
new String[] { "\"foo,\""}
);
checkTokenizer(
new X509NameTokenizer("foo, bar"),
new String[] { "foo", "bar"}
);
checkTokenizer(
new X509NameTokenizer("\"foo bar\", gnu gnat"),
new String[] { "\"foo bar\"", "gnu gnat"}
);
checkTokenizer(
new X509NameTokenizer("foo\\ "),
new String[] { "foo\\ "}
);
checkTokenizer(
new X509NameTokenizer("foo\\\\ "),
new String[] { "foo\\\\"}
);
}