Package org.globus.gsi.bc
Class X509NameHelper
java.lang.Object
org.globus.gsi.bc.X509NameHelper
A helper class to deal with
X509Name
object.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionX509NameHelper
(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
Modifier and TypeMethodDescriptionvoid
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
Converts toX509Name
object.org.bouncycastle.asn1.ASN1Set
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.toString()
Returns Globus format representation of the name.private static String
toString
(org.bouncycastle.asn1.ASN1Sequence seq) static String
toString
(org.bouncycastle.asn1.x509.X509Name name) Returns Globus format representation of the name.
-
Field Details
-
seq
private org.bouncycastle.asn1.ASN1Sequence seq
-
-
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 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 Details
-
getAsName
public org.bouncycastle.asn1.x509.X509Name getAsName()Converts toX509Name
object.- Returns:
- the
X509Name
object.
-
add
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
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
-
toString
Returns Globus format representation of the name.
-