Example usage for org.bouncycastle.asn1.isismtt.x509 NamingAuthority getNamingAuthorityUrl

List of usage examples for org.bouncycastle.asn1.isismtt.x509 NamingAuthority getNamingAuthorityUrl

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.isismtt.x509 NamingAuthority getNamingAuthorityUrl.

Prototype

public String getNamingAuthorityUrl() 

Source Link

Usage

From source file:net.sf.keystore_explorer.crypto.x509.X509Ext.java

License:Open Source License

private String getNamingAuthorityStringValue(NamingAuthority namingAuthority, int indentLevel)
        throws IOException {
    // @formatter:off
    /*/*from   w  ww . j  a  va2  s. co m*/
         NamingAuthority ::= SEQUENCE
         {
     namingAuthorityId OBJECT IDENTIFIER OPTIONAL,
     namingAuthorityUrl IA5String OPTIONAL,
     namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
         }
     */
    // @formatter:on

    StringBuilder sb = new StringBuilder();

    ASN1ObjectIdentifier namingAuthorityId = namingAuthority.getNamingAuthorityId();
    String namingAuthorityUrl = namingAuthority.getNamingAuthorityUrl();
    DirectoryString namingAuthorityText = namingAuthority.getNamingAuthorityText();

    if (namingAuthorityId != null) {
        sb.append(INDENT.toString(indentLevel));
        sb.append(
                MessageFormat.format(res.getString("Admission.NamingAuthorityOID"), namingAuthorityId.getId()));
        sb.append(NEWLINE);
    }

    if (namingAuthorityUrl != null) {
        sb.append(INDENT.toString(indentLevel));
        sb.append(MessageFormat.format(res.getString("Admission.NamingAuthorityURL"), namingAuthorityUrl));
        sb.append(NEWLINE);
    }

    if (namingAuthorityText != null) {
        sb.append(INDENT.toString(indentLevel));
        sb.append(MessageFormat.format(res.getString("Admission.NamingAuthorityText"),
                namingAuthorityText.toString()));
        sb.append(NEWLINE);
    }

    return sb.toString();
}