Package org.globus.gsi.bc

# Class X509NameHelper

java.lang.Object
org.globus.gsi.bc.X509NameHelper

public class X509NameHelper extends Object
A helper class to deal with `X509Name` object.

## Constructor Summary

Constructors
Constructor
Description
`X509NameHelper(org.bouncycastle.asn1.ASN1Sequence seq)`
Creates an instance using the specified ASN.1 sequence.
`X509NameHelper(org.bouncycastle.asn1.x500.X500Name name)`
Creates an instance using existing `X500Name` object.
`X509NameHelper(org.bouncycastle.asn1.x509.X509Name name)`
Creates an instance using existing `X509Name` object.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, String value)`
Appends the specified OID and value pair name component to the end of the current name.
`void`
`add(org.bouncycastle.asn1.ASN1Set entry)`
Appends the specified name component entry to the current name.
`org.bouncycastle.asn1.x509.X509Name`
`getAsName()`
Converts to `X509Name` object.
`org.bouncycastle.asn1.ASN1Set`
`getLastNameEntry()`
Gets the last name component in the current name.
`static org.bouncycastle.asn1.ASN1Set`
`getLastNameEntry(org.bouncycastle.asn1.x500.X500Name name)`
Gets the last name component from the `X509Name` name.
`org.bouncycastle.asn1.ASN1Set`
`getNameEntryAt(int i)`
Gets the name component at specified position.
`String`
`toString()`
Returns Globus format representation of the name.
`static String`
`toString(org.bouncycastle.asn1.x509.X509Name name)`
Returns Globus format representation of the name.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### X509NameHelper

public X509NameHelper(org.bouncycastle.asn1.ASN1Sequence seq)
Creates an instance using the specified ASN.1 sequence.

Parameters:
  `seq` - the name sequence

### X509NameHelper

public X509NameHelper(org.bouncycastle.asn1.x500.X500Name name)
Creates an instance using existing `X500Name` object. This behaves like a copy constructor.

Parameters:
  `name` - existing `X500Name`

### X509NameHelper

public X509NameHelper(org.bouncycastle.asn1.x509.X509Name name)
Creates an instance using existing `X509Name` object. This behaves like a copy constructor.

Parameters:
  `name` - existing `X509Name`

## Method Details

### getAsName

public org.bouncycastle.asn1.x509.X509Name getAsName()
Converts to `X509Name` object.

Returns:
  the `X509Name` object.

### add

public void add(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, String value)
Appends the specified OID and value pair name component to the end of the current name.

Parameters:
  `oid` - the name component oid, e.g. `BCStyle.CN`
  `value` - the value (e.g. "proxy")

### add

public void add(org.bouncycastle.asn1.ASN1Set entry)
Appends the specified name component entry to the current name. This can be used to add handle multiple AVAs in one name component.

Parameters:
  `entry` - the name component to add.

### getNameEntryAt

public org.bouncycastle.asn1.ASN1Set getNameEntryAt(int i)
Gets the name component at specified position.

Returns:
  the name component the specified position.

### getLastNameEntry

public org.bouncycastle.asn1.ASN1Set getLastNameEntry()
Gets the last name component in the current name.

Returns:
  the last name component. Null if there is none.

### getLastNameEntry

public static org.bouncycastle.asn1.ASN1Set getLastNameEntry(org.bouncycastle.asn1.x500.X500Name name)
Gets the last name component from the `X509Name` name.

Returns:
  the last name component. Null if there is none.

### toString

public static String toString(org.bouncycastle.asn1.x509.X509Name name)
Returns Globus format representation of the name. It handles names with multiple AVAs.

Parameters:
  `name` - the name to get the Globus format of.
Returns:
  the Globus format of the name

### toString

public String toString()
Returns Globus format representation of the name.

Overrides:
  `toString` in class `Object`