Java Code Examples for org.bouncycastle.asn1.x509.DisplayText

The following are top voted examples for showing how to use org.bouncycastle.asn1.x509.DisplayText. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: ipack   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 2
Project: gwt-crypto   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 3
Project: Aki-SSL   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 4
Project: keystore-explorer   File: DUserNoticeChooser.java   View source code 6 votes vote down vote up
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);
		}
	}
}
 
Example 5
Project: TinyTravelTracker   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 6
Project: CryptMeme   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 7
Project: irma_future_id   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 8
Project: bc-java   File: SPUserNotice.java   View source code 6 votes vote down vote up
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());
        }
    }
}
 
Example 9
Project: ipack   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 10
Project: gwt-crypto   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 11
Project: Aki-SSL   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 12
Project: TinyTravelTracker   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 13
Project: CryptMeme   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 14
Project: irma_future_id   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 15
Project: bc-java   File: SPUserNotice.java   View source code 5 votes vote down vote up
public SPUserNotice(
    NoticeReference noticeRef,
    DisplayText     explicitText)
{
    this.noticeRef = noticeRef;
    this.explicitText = explicitText;
}
 
Example 16
Project: ipack   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 17
Project: gwt-crypto   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 18
Project: Aki-SSL   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 19
Project: keystore-explorer   File: PolicyInformationUtil.java   View source code 4 votes vote down vote up
/**
 * 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();
}
 
Example 20
Project: TinyTravelTracker   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 21
Project: CryptMeme   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 22
Project: irma_future_id   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}
 
Example 23
Project: bc-java   File: SPUserNotice.java   View source code 4 votes vote down vote up
public DisplayText getExplicitText()
{
    return explicitText;
}