|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.security.authorization.DNConvert
This class is made to convert RFC2253-style Distinguished Name to the older X.500 style frequently used in Globus, or vice versa. It also has method to remove "/CN=proxy" or "/CN=limited proxy" or "/CN=12345..." suffixes from a DN, where 12345... are digits only.
Whitespace is removed in the process, in accordance with RFC2253. Thus, the following code
DNConvert c = new DNConvert("CN=proxy, CN = Olle, O= KTH, C=SE");
System.out.println("["+c.removeProxy(DNConvert.RFC2253)+"]);
System.out.println("["+c.removeProxy(DNConvert.X500)+"]");
yields the following result:
[CN=Olle,O=KTH,C=SE]
[/C=SE/O=KTH/CN=Olle]
Field Summary | |
static int |
RFC2253
The style denoting RFC2253 format of the DN |
static int |
X500
The style denoting the old X.500 format of the DN |
Constructor Summary | |
DNConvert(java.lang.String dn)
|
|
DNConvert(java.lang.String dn,
boolean formatEmailAttr)
|
Method Summary | |
java.lang.String |
reformat(int style)
Converts the DN from one style to another. |
java.lang.String |
removeProxySuffix()
Removes the proxy extension of the DN. |
java.lang.String |
removeProxySuffix(int style)
Removes the proxy extension of the DN. |
static void |
setDefaultEmailAttrFormatting(boolean enabled)
Redefines the default behavior whether to reformat the email address portion of a DN or not. |
void |
setFormatEmailAttr(boolean enabled)
Defines whether to reformat an email attribute in the DN or not |
java.lang.String |
toString()
|
java.lang.String |
trim()
Removes any whitespace between type-value and RDN delimiters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int RFC2253
public static final int X500
Constructor Detail |
public DNConvert(java.lang.String dn)
dn
- The Distuingished Name, in either X.500 or RFC2253 format.public DNConvert(java.lang.String dn, boolean formatEmailAttr)
dn
- The Distuingished Name, in either X.500 or RFC2253 format.formatEmailAttr
- If set, will reformat the email attributeMethod Detail |
public static void setDefaultEmailAttrFormatting(boolean enabled)
enabled
- DNConvert(String, boolean)
,
setFormatEmailAttr(boolean)
public java.lang.String removeProxySuffix(int style)
style
- The style to reformat to (one of X500 or RFC2253)
reformat(int)
public void setFormatEmailAttr(boolean enabled)
enabled
- public java.lang.String removeProxySuffix()
public java.lang.String trim()
Example:" CN=John Doe , O =Org"
returns "CN=John Doe,O=Org"
public java.lang.String reformat(int style)
style
- The style to reformat to (one of X500 or RFC2253)
X500
,
RFC2253
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |