Package org.globus.gsi.bc
Class X509NameHelper
- java.lang.Object
-
- org.globus.gsi.bc.X509NameHelper
-
public class X509NameHelper extends java.lang.Object
A helper class to deal withX509Name
object.
-
-
Field Summary
Fields Modifier and Type Field Description private org.bouncycastle.asn1.ASN1Sequence
seq
-
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 existingX500Name
object.X509NameHelper(org.bouncycastle.asn1.x509.X509Name name)
Creates an instance using existingX509Name
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, java.lang.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 toX509Name
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 theX509Name
name.org.bouncycastle.asn1.ASN1Set
getNameEntryAt(int i)
Gets the name component at specified position.java.lang.String
toString()
Returns Globus format representation of the name.private static java.lang.String
toString(org.bouncycastle.asn1.ASN1Sequence seq)
static java.lang.String
toString(org.bouncycastle.asn1.x509.X509Name name)
Returns Globus format representation of the name.
-
-
-
Constructor Detail
-
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 existingX500Name
object. This behaves like a copy constructor.- Parameters:
name
- existingX500Name
-
X509NameHelper
public X509NameHelper(org.bouncycastle.asn1.x509.X509Name name)
Creates an instance using existingX509Name
object. This behaves like a copy constructor.- Parameters:
name
- existingX509Name
-
-
Method Detail
-
getAsName
public org.bouncycastle.asn1.x509.X509Name getAsName()
Converts toX509Name
object.- Returns:
- the
X509Name
object.
-
add
public void add(org.bouncycastle.asn1.ASN1ObjectIdentifier oid, java.lang.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 theX509Name
name.- Returns:
- the last name component. Null if there is none.
-
toString
public static java.lang.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
private static java.lang.String toString(org.bouncycastle.asn1.ASN1Sequence seq)
-
toString
public java.lang.String toString()
Returns Globus format representation of the name.- Overrides:
toString
in classjava.lang.Object
-
-