本文整理汇总了Java中org.bouncycastle.asn1.x509.DisplayText类的典型用法代码示例。如果您正苦于以下问题:Java DisplayText类的具体用法?Java DisplayText怎么用?Java DisplayText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DisplayText类属于org.bouncycastle.asn1.x509包,在下文中一共展示了DisplayText类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SPUserNotice
import org.bouncycastle.asn1.x509.DisplayText; //导入依赖的package包/类
private SPUserNotice(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1Encodable object = (ASN1Encodable)e.nextElement();
if (object instanceof DisplayText || object instanceof ASN1String)
{
explicitText = DisplayText.getInstance(object);
}
else if (object instanceof NoticeReference || object instanceof ASN1Sequence)
{
noticeRef = NoticeReference.getInstance(object);
}
else
{
throw new IllegalArgumentException("Invalid element in 'SPUserNotice': " + object.getClass().getName());
}
}
}
示例2: populate
import org.bouncycastle.asn1.x509.DisplayText; //导入依赖的package包/类
private void populate(UserNotice userNotice) {
if (userNotice != null) {
NoticeReference noticeReference = userNotice.getNoticeRef();
if (noticeReference != null) {
DisplayText organization = noticeReference.getOrganization();
if (organization != null) {
jtfOrganization.setText(organization.getString());
jtfOrganization.setCaretPosition(0);
}
populateNoticeNumbers(noticeReference);
}
DisplayText explicitText = userNotice.getExplicitText();
if (explicitText != null) {
jtfExplicitText.setText(explicitText.getString());
jtfExplicitText.setCaretPosition(0);
}
}
}
示例3: getExplicitText
import org.bouncycastle.asn1.x509.DisplayText; //导入依赖的package包/类
public DisplayText getExplicitText()
{
return explicitText;
}
示例4: toString
import org.bouncycastle.asn1.x509.DisplayText; //导入依赖的package包/类
/**
* Get string representation of user notice.
*
* @param userNotice
* User notice
* @return String representation of user notice
*/
public static String toString(UserNotice userNotice) {
StringBuffer sbUserNotice = new StringBuffer();
NoticeReference noticeReference = userNotice.getNoticeRef();
if (noticeReference != null) {
DisplayText organization = noticeReference.getOrganization();
if (organization != null) {
sbUserNotice.append(MessageFormat.format(res.getString("PolicyInformationUtil.Organization"),
organization.getString()));
if ((noticeReference.getNoticeNumbers() != null) || (userNotice.getExplicitText() != null)) {
sbUserNotice.append(", ");
}
}
ASN1Integer[] noticeNumbers = noticeReference.getNoticeNumbers();
StringBuffer sbNoticeNumbers = new StringBuffer();
if (noticeNumbers != null) {
for (int i = 0; i < noticeNumbers.length; i++) {
ASN1Integer noticeNumber = noticeNumbers[i];
sbNoticeNumbers.append(noticeNumber.getValue().intValue());
if ((i + 1) < noticeNumbers.length) {
sbNoticeNumbers.append(" ");
}
}
sbUserNotice.append(MessageFormat.format(res.getString("PolicyInformationUtil.NoticeNumbers"),
sbNoticeNumbers.toString()));
if (userNotice.getExplicitText() != null) {
sbUserNotice.append(", ");
}
}
}
DisplayText explicitText = userNotice.getExplicitText();
if (explicitText != null) {
sbUserNotice.append(MessageFormat.format(res.getString("PolicyInformationUtil.ExplicitText"),
explicitText.getString()));
}
return sbUserNotice.toString();
}