directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [2/5] directory-kerby git commit: Get rid of MyEnum in all the kerb-core classes, and a few in pkix.
Date Thu, 24 Dec 2015 12:48:59 GMT
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaAuthnEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaAuthnEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaAuthnEntry.java
index 678245c..86a0b92 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaAuthnEntry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaAuthnEntry.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.PaAuthnEntry.MyEnum.*;
-
 /**
  PA-AUTHENTICATION-SET-ELEM ::= SEQUENCE {
      pa-type      [0] Int32,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.PaAuthnEntry.MyEnum.*;
  }
  */
 public class PaAuthnEntry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaAuthnEntryField implements EnumType {
         PA_TYPE,
         PA_HINT,
         PA_VALUE;
@@ -54,9 +52,9 @@ public class PaAuthnEntry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PA_TYPE, Asn1Integer.class),
-            new ExplicitField(PA_HINT, Asn1OctetString.class),
-            new ExplicitField(PA_VALUE, Asn1OctetString.class)
+            new ExplicitField(PaAuthnEntryField.PA_TYPE, Asn1Integer.class),
+            new ExplicitField(PaAuthnEntryField.PA_HINT, Asn1OctetString.class),
+            new ExplicitField(PaAuthnEntryField.PA_VALUE, Asn1OctetString.class)
     };
 
     public PaAuthnEntry() {
@@ -70,27 +68,27 @@ public class PaAuthnEntry extends KrbSequenceType {
     }
 
     public PaDataType getPaType() {
-        Integer value = getFieldAsInteger(PA_TYPE);
+        Integer value = getFieldAsInteger(PaAuthnEntryField.PA_TYPE);
         return PaDataType.fromValue(value);
     }
 
     public void setPaType(PaDataType paDataType) {
-        setFieldAsInt(PA_TYPE, paDataType.getValue());
+        setFieldAsInt(PaAuthnEntryField.PA_TYPE, paDataType.getValue());
     }
 
     public byte[] getPaHint() {
-        return getFieldAsOctets(PA_HINT);
+        return getFieldAsOctets(PaAuthnEntryField.PA_HINT);
     }
 
     public void setPaHint(byte[] paHint) {
-        setFieldAsOctets(PA_HINT, paHint);
+        setFieldAsOctets(PaAuthnEntryField.PA_HINT, paHint);
     }
 
     public byte[] getPaValue() {
-        return getFieldAsOctets(PA_VALUE);
+        return getFieldAsOctets(PaAuthnEntryField.PA_VALUE);
     }
 
     public void setPaValue(byte[] paValue) {
-        setFieldAsOctets(PA_VALUE, paValue);
+        setFieldAsOctets(PaAuthnEntryField.PA_VALUE, paValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastReply.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastReply.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastReply.java
index 773f59e..a53b5db 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastReply.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastReply.java
@@ -24,15 +24,13 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.PaFxFastReply.MyEnum.*;
-
 /**
  PA-FX-FAST-REPLY ::= CHOICE {
     armored-data [0] KrbFastArmoredRep,
  }
  */
 public class PaFxFastReply extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum PaFxFastReplyField implements EnumType {
         ARMORED_DATA;
 
         @Override
@@ -47,7 +45,7 @@ public class PaFxFastReply extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ARMORED_DATA, KrbFastArmoredRep.class)
+            new ExplicitField(PaFxFastReplyField.ARMORED_DATA, KrbFastArmoredRep.class)
     };
 
     public PaFxFastReply() {
@@ -55,10 +53,10 @@ public class PaFxFastReply extends Asn1Choice {
     }
 
     public KrbFastArmoredRep getFastArmoredRep() {
-        return getChoiceValueAs(ARMORED_DATA, KrbFastArmoredRep.class);
+        return getChoiceValueAs(PaFxFastReplyField.ARMORED_DATA, KrbFastArmoredRep.class);
     }
 
     public void setFastArmoredRep(KrbFastArmoredRep fastArmoredRep) {
-        setChoiceValue(ARMORED_DATA, fastArmoredRep);
+        setChoiceValue(PaFxFastReplyField.ARMORED_DATA, fastArmoredRep);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastRequest.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastRequest.java
index 06f1015..67b6f14 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastRequest.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/PaFxFastRequest.java
@@ -24,15 +24,13 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.PaFxFastRequest.MyEnum.*;
-
 /**
  PA-FX-FAST-REQUEST ::= CHOICE {
     armored-data [0] KrbFastArmoredReq,
  }
  */
 public class PaFxFastRequest extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum PaFxFastRequestField implements EnumType {
         ARMORED_DATA;
 
         @Override
@@ -47,7 +45,7 @@ public class PaFxFastRequest extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ARMORED_DATA, KrbFastArmoredReq.class)
+            new ExplicitField(PaFxFastRequestField.ARMORED_DATA, KrbFastArmoredReq.class)
     };
 
     public PaFxFastRequest() {
@@ -55,10 +53,10 @@ public class PaFxFastRequest extends Asn1Choice {
     }
 
     public KrbFastArmoredReq getFastArmoredReq() {
-        return getChoiceValueAs(ARMORED_DATA, KrbFastArmoredReq.class);
+        return getChoiceValueAs(PaFxFastRequestField.ARMORED_DATA, KrbFastArmoredReq.class);
     }
 
     public void setFastArmoredReq(KrbFastArmoredReq fastArmoredReq) {
-        setChoiceValue(ARMORED_DATA, fastArmoredReq);
+        setChoiceValue(PaFxFastRequestField.ARMORED_DATA, fastArmoredReq);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/EncKdcRepPart.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/EncKdcRepPart.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/EncKdcRepPart.java
index 01fd54d..f66c3b3 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/EncKdcRepPart.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/EncKdcRepPart.java
@@ -32,8 +32,6 @@ import org.apache.kerby.kerberos.kerb.type.base.LastReq;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 import org.apache.kerby.kerberos.kerb.type.ticket.TicketFlags;
 
-import static org.apache.kerby.kerberos.kerb.type.kdc.EncKdcRepPart.MyEnum.*;
-
 /**
  EncKDCRepPart   ::= SEQUENCE {
  key             [0] EncryptionKey,
@@ -51,7 +49,7 @@ import static org.apache.kerby.kerberos.kerb.type.kdc.EncKdcRepPart.MyEnum.*;
  }
  */
 public abstract class EncKdcRepPart extends KrbAppSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EncKdcRepPartField implements EnumType {
         KEY,
         LAST_REQ,
         NONCE,
@@ -77,18 +75,18 @@ public abstract class EncKdcRepPart extends KrbAppSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(KEY, EncryptionKey.class),
-            new ExplicitField(LAST_REQ, LastReq.class),
-            new ExplicitField(NONCE, Asn1Integer.class),
-            new ExplicitField(KEY_EXPIRATION, KerberosTime.class),
-            new ExplicitField(FLAGS, TicketFlags.class),
-            new ExplicitField(AUTHTIME, KerberosTime.class),
-            new ExplicitField(STARTTIME, KerberosTime.class),
-            new ExplicitField(ENDTIME, KerberosTime.class),
-            new ExplicitField(RENEW_TILL, KerberosTime.class),
-            new ExplicitField(SREALM, KerberosString.class),
-            new ExplicitField(SNAME, PrincipalName.class),
-            new ExplicitField(CADDR, HostAddresses.class)
+            new ExplicitField(EncKdcRepPartField.KEY, EncryptionKey.class),
+            new ExplicitField(EncKdcRepPartField.LAST_REQ, LastReq.class),
+            new ExplicitField(EncKdcRepPartField.NONCE, Asn1Integer.class),
+            new ExplicitField(EncKdcRepPartField.KEY_EXPIRATION, KerberosTime.class),
+            new ExplicitField(EncKdcRepPartField.FLAGS, TicketFlags.class),
+            new ExplicitField(EncKdcRepPartField.AUTHTIME, KerberosTime.class),
+            new ExplicitField(EncKdcRepPartField.STARTTIME, KerberosTime.class),
+            new ExplicitField(EncKdcRepPartField.ENDTIME, KerberosTime.class),
+            new ExplicitField(EncKdcRepPartField.RENEW_TILL, KerberosTime.class),
+            new ExplicitField(EncKdcRepPartField.SREALM, KerberosString.class),
+            new ExplicitField(EncKdcRepPartField.SNAME, PrincipalName.class),
+            new ExplicitField(EncKdcRepPartField.CADDR, HostAddresses.class)
     };
 
     public EncKdcRepPart(int tagNo) {
@@ -96,98 +94,98 @@ public abstract class EncKdcRepPart extends KrbAppSequenceType {
     }
 
     public EncryptionKey getKey() {
-        return getFieldAs(KEY, EncryptionKey.class);
+        return getFieldAs(EncKdcRepPartField.KEY, EncryptionKey.class);
     }
 
     public void setKey(EncryptionKey key) {
-        setFieldAs(KEY, key);
+        setFieldAs(EncKdcRepPartField.KEY, key);
     }
 
     public LastReq getLastReq() {
-        return getFieldAs(LAST_REQ, LastReq.class);
+        return getFieldAs(EncKdcRepPartField.LAST_REQ, LastReq.class);
     }
 
     public void setLastReq(LastReq lastReq) {
-        setFieldAs(LAST_REQ, lastReq);
+        setFieldAs(EncKdcRepPartField.LAST_REQ, lastReq);
     }
 
     public int getNonce() {
-        return getFieldAsInt(NONCE);
+        return getFieldAsInt(EncKdcRepPartField.NONCE);
     }
 
     public void setNonce(int nonce) {
-        setFieldAsInt(NONCE, nonce);
+        setFieldAsInt(EncKdcRepPartField.NONCE, nonce);
     }
 
     public KerberosTime getKeyExpiration() {
-        return getFieldAsTime(KEY_EXPIRATION);
+        return getFieldAsTime(EncKdcRepPartField.KEY_EXPIRATION);
     }
 
     public void setKeyExpiration(KerberosTime keyExpiration) {
-        setFieldAs(KEY_EXPIRATION, keyExpiration);
+        setFieldAs(EncKdcRepPartField.KEY_EXPIRATION, keyExpiration);
     }
 
     public TicketFlags getFlags() {
-        return getFieldAs(FLAGS, TicketFlags.class);
+        return getFieldAs(EncKdcRepPartField.FLAGS, TicketFlags.class);
     }
 
     public void setFlags(TicketFlags flags) {
-        setFieldAs(FLAGS, flags);
+        setFieldAs(EncKdcRepPartField.FLAGS, flags);
     }
 
     public KerberosTime getAuthTime() {
-        return getFieldAsTime(AUTHTIME);
+        return getFieldAsTime(EncKdcRepPartField.AUTHTIME);
     }
 
     public void setAuthTime(KerberosTime authTime) {
-        setFieldAs(AUTHTIME, authTime);
+        setFieldAs(EncKdcRepPartField.AUTHTIME, authTime);
     }
 
     public KerberosTime getStartTime() {
-        return getFieldAsTime(STARTTIME);
+        return getFieldAsTime(EncKdcRepPartField.STARTTIME);
     }
 
     public void setStartTime(KerberosTime startTime) {
-        setFieldAs(STARTTIME, startTime);
+        setFieldAs(EncKdcRepPartField.STARTTIME, startTime);
     }
 
     public KerberosTime getEndTime() {
-        return getFieldAsTime(ENDTIME);
+        return getFieldAsTime(EncKdcRepPartField.ENDTIME);
     }
 
     public void setEndTime(KerberosTime endTime) {
-        setFieldAs(ENDTIME, endTime);
+        setFieldAs(EncKdcRepPartField.ENDTIME, endTime);
     }
 
     public KerberosTime getRenewTill() {
-        return getFieldAsTime(RENEW_TILL);
+        return getFieldAsTime(EncKdcRepPartField.RENEW_TILL);
     }
 
     public void setRenewTill(KerberosTime renewTill) {
-        setFieldAs(RENEW_TILL, renewTill);
+        setFieldAs(EncKdcRepPartField.RENEW_TILL, renewTill);
     }
 
     public String getSrealm() {
-        return getFieldAsString(SREALM);
+        return getFieldAsString(EncKdcRepPartField.SREALM);
     }
 
     public void setSrealm(String srealm) {
-        setFieldAsString(SREALM, srealm);
+        setFieldAsString(EncKdcRepPartField.SREALM, srealm);
     }
 
     public PrincipalName getSname() {
-        return getFieldAs(SNAME, PrincipalName.class);
+        return getFieldAs(EncKdcRepPartField.SNAME, PrincipalName.class);
     }
 
     public void setSname(PrincipalName sname) {
-        setFieldAs(SNAME, sname);
+        setFieldAs(EncKdcRepPartField.SNAME, sname);
     }
 
     public HostAddresses getCaddr() {
-        return getFieldAs(CADDR, HostAddresses.class);
+        return getFieldAs(EncKdcRepPartField.CADDR, HostAddresses.class);
     }
 
     public void setCaddr(HostAddresses caddr) {
-        setFieldAs(CADDR, caddr);
+        setFieldAs(EncKdcRepPartField.CADDR, caddr);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcRep.java
index 6f934e6..ab47e34 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcRep.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcRep.java
@@ -31,8 +31,6 @@ import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 import org.apache.kerby.kerberos.kerb.type.ticket.Ticket;
 
-import static org.apache.kerby.kerberos.kerb.type.kdc.KdcRep.MyEnum.*;
-
 /**
  KDC-REP         ::= SEQUENCE {
  pvno            [0] INTEGER (5),
@@ -48,7 +46,7 @@ import static org.apache.kerby.kerberos.kerb.type.kdc.KdcRep.MyEnum.*;
  }
  */
 public class KdcRep extends KrbMessage {
-    protected enum MyEnum implements EnumType {
+    protected enum KdcRepField implements EnumType {
         PVNO,
         MSG_TYPE,
         PADATA,
@@ -69,13 +67,13 @@ public class KdcRep extends KrbMessage {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PVNO, Asn1Integer.class),
-            new ExplicitField(MSG_TYPE, Asn1Integer.class),
-            new ExplicitField(PADATA, PaData.class),
-            new ExplicitField(CREALM, KerberosString.class),
-            new ExplicitField(CNAME, PrincipalName.class),
-            new ExplicitField(TICKET, Ticket.class),
-            new ExplicitField(ENC_PART, EncryptedData.class)
+            new ExplicitField(KdcRepField.PVNO, Asn1Integer.class),
+            new ExplicitField(KdcRepField.MSG_TYPE, Asn1Integer.class),
+            new ExplicitField(KdcRepField.PADATA, PaData.class),
+            new ExplicitField(KdcRepField.CREALM, KerberosString.class),
+            new ExplicitField(KdcRepField.CNAME, PrincipalName.class),
+            new ExplicitField(KdcRepField.TICKET, Ticket.class),
+            new ExplicitField(KdcRepField.ENC_PART, EncryptedData.class)
     };
 
     private EncKdcRepPart encPart;
@@ -85,43 +83,43 @@ public class KdcRep extends KrbMessage {
     }
 
     public PaData getPaData() {
-        return getFieldAs(PADATA, PaData.class);
+        return getFieldAs(KdcRepField.PADATA, PaData.class);
     }
 
     public void setPaData(PaData paData) {
-        setFieldAs(PADATA, paData);
+        setFieldAs(KdcRepField.PADATA, paData);
     }
 
     public PrincipalName getCname() {
-        return getFieldAs(CNAME, PrincipalName.class);
+        return getFieldAs(KdcRepField.CNAME, PrincipalName.class);
     }
 
     public void setCname(PrincipalName sname) {
-        setFieldAs(CNAME, sname);
+        setFieldAs(KdcRepField.CNAME, sname);
     }
 
     public String getCrealm() {
-        return getFieldAsString(CREALM);
+        return getFieldAsString(KdcRepField.CREALM);
     }
 
     public void setCrealm(String realm) {
-        setFieldAs(CREALM, new KerberosString(realm));
+        setFieldAs(KdcRepField.CREALM, new KerberosString(realm));
     }
 
     public Ticket getTicket() {
-        return getFieldAs(TICKET, Ticket.class);
+        return getFieldAs(KdcRepField.TICKET, Ticket.class);
     }
 
     public void setTicket(Ticket ticket) {
-        setFieldAs(TICKET, ticket);
+        setFieldAs(KdcRepField.TICKET, ticket);
     }
 
     public EncryptedData getEncryptedEncPart() {
-        return getFieldAs(ENC_PART, EncryptedData.class);
+        return getFieldAs(KdcRepField.ENC_PART, EncryptedData.class);
     }
 
     public void setEncryptedEncPart(EncryptedData encryptedEncPart) {
-        setFieldAs(ENC_PART, encryptedEncPart);
+        setFieldAs(KdcRepField.ENC_PART, encryptedEncPart);
     }
 
     public EncKdcRepPart getEncPart() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReq.java
index 50f3f45..4cf8d82 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReq.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReq.java
@@ -28,8 +28,6 @@ import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
 import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
 
-import static org.apache.kerby.kerberos.kerb.type.kdc.KdcReq.MyEnum.*;
-
 /**
  KDC-REQ         ::= SEQUENCE {
  -- NOTE: first tag is [1], not [0]
@@ -41,7 +39,7 @@ import static org.apache.kerby.kerberos.kerb.type.kdc.KdcReq.MyEnum.*;
  }
  */
 public class KdcReq extends KrbMessage {
-    protected enum MyEnum implements EnumType {
+    protected enum KdcReqField implements EnumType {
         PVNO,
         MSG_TYPE,
         PADATA,
@@ -59,10 +57,10 @@ public class KdcReq extends KrbMessage {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PVNO, 1, Asn1Integer.class),
-            new ExplicitField(MSG_TYPE, 2, Asn1Integer.class),
-            new ExplicitField(PADATA, 3, PaData.class),
-            new ExplicitField(REQ_BODY, 4, KdcReqBody.class)
+            new ExplicitField(KdcReqField.PVNO, 1, Asn1Integer.class),
+            new ExplicitField(KdcReqField.MSG_TYPE, 2, Asn1Integer.class),
+            new ExplicitField(KdcReqField.PADATA, 3, PaData.class),
+            new ExplicitField(KdcReqField.REQ_BODY, 4, KdcReqBody.class)
     };
 
     public KdcReq(KrbMessageType msgType) {
@@ -70,11 +68,11 @@ public class KdcReq extends KrbMessage {
     }
 
     public PaData getPaData() {
-        return getFieldAs(PADATA, PaData.class);
+        return getFieldAs(KdcReqField.PADATA, PaData.class);
     }
 
     public void setPaData(PaData paData) {
-        setFieldAs(PADATA, paData);
+        setFieldAs(KdcReqField.PADATA, paData);
     }
 
     public void addPaData(PaDataEntry paDataEntry) {
@@ -85,10 +83,10 @@ public class KdcReq extends KrbMessage {
     }
 
     public KdcReqBody getReqBody() {
-        return getFieldAs(REQ_BODY, KdcReqBody.class);
+        return getFieldAs(KdcReqField.REQ_BODY, KdcReqBody.class);
     }
 
     public void setReqBody(KdcReqBody reqBody) {
-        setFieldAs(REQ_BODY, reqBody);
+        setFieldAs(KdcReqField.REQ_BODY, reqBody);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
index 0e1cee0..2c171a6 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/kdc/KdcReqBody.java
@@ -19,6 +19,10 @@
  */
 package org.apache.kerby.kerberos.kerb.type.kdc;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -34,12 +38,6 @@ import org.apache.kerby.kerberos.kerb.type.base.HostAddresses;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 import org.apache.kerby.kerberos.kerb.type.ticket.Tickets;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import static org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody.MyEnum.*;
-
 /**
  KDC-REQ-BODY    ::= SEQUENCE {
  kdc-options             [0] KDCOptions,
@@ -63,7 +61,7 @@ import static org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody.MyEnum.*;
  }
  */
 public class KdcReqBody extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KdcReqBodyField implements EnumType {
         KDC_OPTIONS,
         CNAME,
         REALM,
@@ -89,18 +87,18 @@ public class KdcReqBody extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(KDC_OPTIONS, KdcOptions.class),
-            new ExplicitField(CNAME, PrincipalName.class),
-            new ExplicitField(REALM, KerberosString.class),
-            new ExplicitField(SNAME, PrincipalName.class),
-            new ExplicitField(FROM, KerberosTime.class),
-            new ExplicitField(TILL, KerberosTime.class),
-            new ExplicitField(RTIME, KerberosTime.class),
-            new ExplicitField(NONCE, Asn1Integer.class),
-            new ExplicitField(ETYPE, KrbIntegers.class),
-            new ExplicitField(ADDRESSES, HostAddresses.class),
-            new ExplicitField(ENC_AUTHORIZATION_DATA, AuthorizationData.class),
-            new ExplicitField(ADDITIONAL_TICKETS, Tickets.class)
+            new ExplicitField(KdcReqBodyField.KDC_OPTIONS, KdcOptions.class),
+            new ExplicitField(KdcReqBodyField.CNAME, PrincipalName.class),
+            new ExplicitField(KdcReqBodyField.REALM, KerberosString.class),
+            new ExplicitField(KdcReqBodyField.SNAME, PrincipalName.class),
+            new ExplicitField(KdcReqBodyField.FROM, KerberosTime.class),
+            new ExplicitField(KdcReqBodyField.TILL, KerberosTime.class),
+            new ExplicitField(KdcReqBodyField.RTIME, KerberosTime.class),
+            new ExplicitField(KdcReqBodyField.NONCE, Asn1Integer.class),
+            new ExplicitField(KdcReqBodyField.ETYPE, KrbIntegers.class),
+            new ExplicitField(KdcReqBodyField.ADDRESSES, HostAddresses.class),
+            new ExplicitField(KdcReqBodyField.ENC_AUTHORIZATION_DATA, AuthorizationData.class),
+            new ExplicitField(KdcReqBodyField.ADDITIONAL_TICKETS, Tickets.class)
     };
 
     public KdcReqBody() {
@@ -110,39 +108,39 @@ public class KdcReqBody extends KrbSequenceType {
     private AuthorizationData authorizationData;
 
     public KerberosTime getFrom() {
-        return getFieldAs(FROM, KerberosTime.class);
+        return getFieldAs(KdcReqBodyField.FROM, KerberosTime.class);
     }
 
     public void setFrom(KerberosTime from) {
-        setFieldAs(FROM, from);
+        setFieldAs(KdcReqBodyField.FROM, from);
     }
 
     public KerberosTime getTill() {
-        return getFieldAs(TILL, KerberosTime.class);
+        return getFieldAs(KdcReqBodyField.TILL, KerberosTime.class);
     }
 
     public void setTill(KerberosTime till) {
-        setFieldAs(TILL, till);
+        setFieldAs(KdcReqBodyField.TILL, till);
     }
 
     public KerberosTime getRtime() {
-        return getFieldAs(RTIME, KerberosTime.class);
+        return getFieldAs(KdcReqBodyField.RTIME, KerberosTime.class);
     }
 
     public void setRtime(KerberosTime rtime) {
-        setFieldAs(RTIME, rtime);
+        setFieldAs(KdcReqBodyField.RTIME, rtime);
     }
 
     public int getNonce() {
-        return getFieldAsInt(NONCE);
+        return getFieldAsInt(KdcReqBodyField.NONCE);
     }
 
     public void setNonce(int nonce) {
-        setFieldAsInt(NONCE, nonce);
+        setFieldAsInt(KdcReqBodyField.NONCE, nonce);
     }
 
     public List<EncryptionType> getEtypes() {
-        KrbIntegers values = getFieldAs(ETYPE, KrbIntegers.class);
+        KrbIntegers values = getFieldAs(KdcReqBodyField.ETYPE, KrbIntegers.class);
         if (values == null) {
             return Collections.emptyList();
         }
@@ -160,23 +158,23 @@ public class KdcReqBody extends KrbSequenceType {
             values.add(etype.getValue());
         }
         KrbIntegers value = new KrbIntegers(values);
-        setFieldAs(ETYPE, value);
+        setFieldAs(KdcReqBodyField.ETYPE, value);
     }
 
     public HostAddresses getAddresses() {
-        return getFieldAs(ADDRESSES, HostAddresses.class);
+        return getFieldAs(KdcReqBodyField.ADDRESSES, HostAddresses.class);
     }
 
     public void setAddresses(HostAddresses addresses) {
-        setFieldAs(ADDRESSES, addresses);
+        setFieldAs(KdcReqBodyField.ADDRESSES, addresses);
     }
 
     public EncryptedData getEncryptedAuthorizationData() {
-        return getFieldAs(ENC_AUTHORIZATION_DATA, EncryptedData.class);
+        return getFieldAs(KdcReqBodyField.ENC_AUTHORIZATION_DATA, EncryptedData.class);
     }
 
     public void setEncryptedAuthorizationData(EncryptedData encAuthorizationData) {
-        setFieldAs(ENC_AUTHORIZATION_DATA, encAuthorizationData);
+        setFieldAs(KdcReqBodyField.ENC_AUTHORIZATION_DATA, encAuthorizationData);
     }
 
     public AuthorizationData getAuthorizationData() {
@@ -188,42 +186,42 @@ public class KdcReqBody extends KrbSequenceType {
     }
 
     public Tickets getAdditionalTickets() {
-        return getFieldAs(ADDITIONAL_TICKETS, Tickets.class);
+        return getFieldAs(KdcReqBodyField.ADDITIONAL_TICKETS, Tickets.class);
     }
 
     public void setAdditionalTickets(Tickets additionalTickets) {
-        setFieldAs(ADDITIONAL_TICKETS, additionalTickets);
+        setFieldAs(KdcReqBodyField.ADDITIONAL_TICKETS, additionalTickets);
     }
 
     public KdcOptions getKdcOptions() {
-        return getFieldAs(KDC_OPTIONS, KdcOptions.class);
+        return getFieldAs(KdcReqBodyField.KDC_OPTIONS, KdcOptions.class);
     }
 
     public void setKdcOptions(KdcOptions kdcOptions) {
-        setFieldAs(KDC_OPTIONS, kdcOptions);
+        setFieldAs(KdcReqBodyField.KDC_OPTIONS, kdcOptions);
     }
 
     public PrincipalName getSname() {
-        return getFieldAs(SNAME, PrincipalName.class);
+        return getFieldAs(KdcReqBodyField.SNAME, PrincipalName.class);
     }
 
     public void setSname(PrincipalName sname) {
-        setFieldAs(SNAME, sname);
+        setFieldAs(KdcReqBodyField.SNAME, sname);
     }
 
     public PrincipalName getCname() {
-        return getFieldAs(CNAME, PrincipalName.class);
+        return getFieldAs(KdcReqBodyField.CNAME, PrincipalName.class);
     }
 
     public void setCname(PrincipalName cname) {
-        setFieldAs(CNAME, cname);
+        setFieldAs(KdcReqBodyField.CNAME, cname);
     }
 
     public String getRealm() {
-        return getFieldAsString(REALM);
+        return getFieldAsString(KdcReqBodyField.REALM);
     }
 
     public void setRealm(String realm) {
-        setFieldAs(REALM, new KerberosString(realm));
+        setFieldAs(KdcReqBodyField.REALM, new KerberosString(realm));
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaAuthenticationSetElem.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaAuthenticationSetElem.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaAuthenticationSetElem.java
index 0f160bf..297b992 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaAuthenticationSetElem.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaAuthenticationSetElem.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.PaAuthenticationSetElem.MyEnum.*;
-
 /**
  PA-AUTHENTICATION-SET-ELEM ::= SEQUENCE {
      pa-type      [0] Int32,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.PaAuthenticationSetElem.MyE
  }
  */
 public class PaAuthenticationSetElem extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaAuthenticationSetElemField implements EnumType {
         PA_TYPE,
         PA_HINT,
         PA_VALUE;
@@ -54,9 +52,9 @@ public class PaAuthenticationSetElem extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PA_TYPE, Asn1Integer.class),
-            new ExplicitField(PA_HINT, Asn1OctetString.class),
-            new ExplicitField(PA_VALUE, Asn1OctetString.class)
+            new ExplicitField(PaAuthenticationSetElemField.PA_TYPE, Asn1Integer.class),
+            new ExplicitField(PaAuthenticationSetElemField.PA_HINT, Asn1OctetString.class),
+            new ExplicitField(PaAuthenticationSetElemField.PA_VALUE, Asn1OctetString.class)
     };
 
     public PaAuthenticationSetElem() {
@@ -64,27 +62,27 @@ public class PaAuthenticationSetElem extends KrbSequenceType {
     }
 
     public PaDataType getPaType() {
-        Integer value = getFieldAsInteger(PA_TYPE);
+        Integer value = getFieldAsInteger(PaAuthenticationSetElemField.PA_TYPE);
         return PaDataType.fromValue(value);
     }
 
     public void setPaType(PaDataType paDataType) {
-        setFieldAsInt(PA_TYPE, paDataType.getValue());
+        setFieldAsInt(PaAuthenticationSetElemField.PA_TYPE, paDataType.getValue());
     }
 
     public byte[] getPaHint() {
-        return getFieldAsOctets(PA_HINT);
+        return getFieldAsOctets(PaAuthenticationSetElemField.PA_HINT);
     }
 
     public void setPaHint(byte[] paHint) {
-        setFieldAsOctets(PA_HINT, paHint);
+        setFieldAsOctets(PaAuthenticationSetElemField.PA_HINT, paHint);
     }
 
     public byte[] getPaValue() {
-        return getFieldAsOctets(PA_VALUE);
+        return getFieldAsOctets(PaAuthenticationSetElemField.PA_VALUE);
     }
 
     public void setPaValue(byte[] paDataValue) {
-        setFieldAsOctets(PA_VALUE, paDataValue);
+        setFieldAsOctets(PaAuthenticationSetElemField.PA_VALUE, paDataValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaDataEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaDataEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaDataEntry.java
index 4f7fcbf..9b340c0 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaDataEntry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaDataEntry.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry.MyEnum.*;
-
 /**
  PA-DATA         ::= SEQUENCE {
      -- NOTE: first tag is [1], not [0]
@@ -36,7 +34,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry.MyEnum.*;
  }
  */
 public class PaDataEntry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaDataEntryField implements EnumType {
         PADATA_TYPE,
         PADATA_VALUE;
 
@@ -52,8 +50,8 @@ public class PaDataEntry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PADATA_TYPE, 1, Asn1Integer.class),
-            new ExplicitField(PADATA_VALUE, 2, Asn1OctetString.class)
+            new ExplicitField(PaDataEntryField.PADATA_TYPE, 1, Asn1Integer.class),
+            new ExplicitField(PaDataEntryField.PADATA_VALUE, 2, Asn1OctetString.class)
     };
 
     public PaDataEntry() {
@@ -67,19 +65,19 @@ public class PaDataEntry extends KrbSequenceType {
     }
 
     public PaDataType getPaDataType() {
-        Integer value = getFieldAsInteger(PADATA_TYPE);
+        Integer value = getFieldAsInteger(PaDataEntryField.PADATA_TYPE);
         return PaDataType.fromValue(value);
     }
 
     public void setPaDataType(PaDataType paDataType) {
-        setFieldAsInt(PADATA_TYPE, paDataType.getValue());
+        setFieldAsInt(PaDataEntryField.PADATA_TYPE, paDataType.getValue());
     }
 
     public byte[] getPaDataValue() {
-        return getFieldAsOctets(PADATA_VALUE);
+        return getFieldAsOctets(PaDataEntryField.PADATA_VALUE);
     }
 
     public void setPaDataValue(byte[] paDataValue) {
-        setFieldAsOctets(PADATA_VALUE, paDataValue);
+        setFieldAsOctets(PaDataEntryField.PADATA_VALUE, paDataValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaEncTsEnc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaEncTsEnc.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaEncTsEnc.java
index d51d278..437fdf3 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaEncTsEnc.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/PaEncTsEnc.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.PaEncTsEnc.MyEnum.*;
-
 /**
  PA-ENC-TS-ENC           ::= SEQUENCE {
     patimestamp     [0] KerberosTime -- client's time --,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.PaEncTsEnc.MyEnum.*;
  }
  */
 public class PaEncTsEnc extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaEncTsEncField implements EnumType {
         PATIMESTAMP,
         PAUSEC;
 
@@ -51,8 +49,8 @@ public class PaEncTsEnc extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PATIMESTAMP, 0, KerberosTime.class),
-            new ExplicitField(PAUSEC, 1, Asn1Integer.class)
+            new ExplicitField(PaEncTsEncField.PATIMESTAMP, KerberosTime.class),
+            new ExplicitField(PaEncTsEncField.PAUSEC, Asn1Integer.class)
     };
 
     public PaEncTsEnc() {
@@ -60,19 +58,19 @@ public class PaEncTsEnc extends KrbSequenceType {
     }
 
     public KerberosTime getPaTimestamp() {
-        return getFieldAsTime(PATIMESTAMP);
+        return getFieldAsTime(PaEncTsEncField.PATIMESTAMP);
     }
 
     public void setPaTimestamp(KerberosTime paTimestamp) {
-        setFieldAs(PATIMESTAMP, paTimestamp);
+        setFieldAs(PaEncTsEncField.PATIMESTAMP, paTimestamp);
     }
 
     public int getPaUsec() {
-        return getFieldAsInt(PAUSEC);
+        return getFieldAsInt(PaEncTsEncField.PAUSEC);
     }
 
     public void setPaUsec(int paUsec) {
-        setFieldAsInt(PAUSEC, paUsec);
+        setFieldAsInt(PaEncTsEncField.PAUSEC, paUsec);
     }
 
     public KerberosTime getAllTime() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/OtpTokenInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/OtpTokenInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/OtpTokenInfo.java
index 945c9c3..6d2d1df 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/OtpTokenInfo.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/OtpTokenInfo.java
@@ -29,7 +29,6 @@ import org.apache.kerby.kerberos.kerb.type.KerberosString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.AlgorithmIdentifiers;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.otp.OtpTokenInfo.MyEnum.*;
 
 /**
  OTP-TOKENINFO ::= SEQUENCE {
@@ -45,7 +44,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.otp.OtpTokenInfo.MyEnum.*;
  }
  */
 public class OtpTokenInfo extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtpTokenInfoField implements EnumType {
         FLAGS,
         OTP_VENDOR,
         OTP_CHALLENGE,
@@ -68,15 +67,15 @@ public class OtpTokenInfo extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(FLAGS, Asn1OctetString.class),
-            new ExplicitField(OTP_VENDOR, Asn1Utf8String.class),
-            new ExplicitField(OTP_CHALLENGE, Asn1OctetString.class),
-            new ExplicitField(OTP_LENGTH, KerberosString.class),
-            new ExplicitField(OTP_FORMAT, Asn1OctetString.class),
-            new ExplicitField(OTP_TOKEN_ID, Asn1Utf8String.class),
-            new ExplicitField(OTP_ALG_ID, Asn1OctetString.class),
-            new ExplicitField(SUPPORTED_HASH_ALG, AlgorithmIdentifiers.class),
-            new ExplicitField(ITERATION_COUNT, Asn1Integer.class)
+            new ExplicitField(OtpTokenInfoField.FLAGS, Asn1OctetString.class),
+            new ExplicitField(OtpTokenInfoField.OTP_VENDOR, Asn1Utf8String.class),
+            new ExplicitField(OtpTokenInfoField.OTP_CHALLENGE, Asn1OctetString.class),
+            new ExplicitField(OtpTokenInfoField.OTP_LENGTH, KerberosString.class),
+            new ExplicitField(OtpTokenInfoField.OTP_FORMAT, Asn1OctetString.class),
+            new ExplicitField(OtpTokenInfoField.OTP_TOKEN_ID, Asn1Utf8String.class),
+            new ExplicitField(OtpTokenInfoField.OTP_ALG_ID, Asn1OctetString.class),
+            new ExplicitField(OtpTokenInfoField.SUPPORTED_HASH_ALG, AlgorithmIdentifiers.class),
+            new ExplicitField(OtpTokenInfoField.ITERATION_COUNT, Asn1Integer.class)
     };
 
     public OtpTokenInfo() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/PaOtpChallenge.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/PaOtpChallenge.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/PaOtpChallenge.java
index 8930bac..155ff79 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/PaOtpChallenge.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/otp/PaOtpChallenge.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1Utf8String;
 import org.apache.kerby.kerberos.kerb.type.KerberosString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.otp.PaOtpChallenge.MyEnum.*;
-
 /**
  PA-OTP-CHALLENGE ::= SEQUENCE {
      nonce            [0] OCTET STRING,
@@ -39,7 +37,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.otp.PaOtpChallenge.MyEnum.*
  }
  */
 public class PaOtpChallenge extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaOtpChallengeField implements EnumType {
         NONCE,
         OTP_SERVICE,
         OTP_TOKEN_INFO,
@@ -58,11 +56,11 @@ public class PaOtpChallenge extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(NONCE, Asn1OctetString.class),
-            new ExplicitField(OTP_SERVICE, Asn1Utf8String.class),
-            new ExplicitField(OTP_TOKEN_INFO, Asn1OctetString.class),
-            new ExplicitField(SALT, KerberosString.class),
-            new ExplicitField(S2KPARAMS, Asn1OctetString.class)
+            new ExplicitField(PaOtpChallengeField.NONCE, Asn1OctetString.class),
+            new ExplicitField(PaOtpChallengeField.OTP_SERVICE, Asn1Utf8String.class),
+            new ExplicitField(PaOtpChallengeField.OTP_TOKEN_INFO, Asn1OctetString.class),
+            new ExplicitField(PaOtpChallengeField.SALT, KerberosString.class),
+            new ExplicitField(PaOtpChallengeField.S2KPARAMS, Asn1OctetString.class)
     };
 
     public PaOtpChallenge() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/AuthPack.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/AuthPack.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/AuthPack.java
index 1e3e4fa..0b75714 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/AuthPack.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/AuthPack.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.x509.type.SubjectPublicKeyInfo;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack.MyEnum.*;
-
 /**
  AuthPack ::= SEQUENCE {
      pkAuthenticator         [0] PKAuthenticator,
@@ -36,7 +34,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack.MyEnum.*;
  }
  */
 public class AuthPack extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AuthPackField implements EnumType {
         PK_AUTHENTICATOR,
         CLIENT_PUBLIC_VALUE,
         SUPPORTED_CMS_TYPES,
@@ -55,11 +53,11 @@ public class AuthPack extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PK_AUTHENTICATOR, PkAuthenticator.class),
-            new ExplicitField(CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class),
-            new ExplicitField(SUPPORTED_CMS_TYPES, AlgorithmIdentifiers.class),
-            new ExplicitField(CLIENT_DH_NONCE, DHNonce.class),
-            new ExplicitField(SUPPORTED_KDFS, SupportedKDFs.class)
+            new ExplicitField(AuthPackField.PK_AUTHENTICATOR, PkAuthenticator.class),
+            new ExplicitField(AuthPackField.CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class),
+            new ExplicitField(AuthPackField.SUPPORTED_CMS_TYPES, AlgorithmIdentifiers.class),
+            new ExplicitField(AuthPackField.CLIENT_DH_NONCE, DHNonce.class),
+            new ExplicitField(AuthPackField.SUPPORTED_KDFS, SupportedKDFs.class)
     };
 
     public AuthPack() {
@@ -67,42 +65,42 @@ public class AuthPack extends KrbSequenceType {
     }
 
     public PkAuthenticator getPkAuthenticator() {
-        return getFieldAs(PK_AUTHENTICATOR, PkAuthenticator.class);
+        return getFieldAs(AuthPackField.PK_AUTHENTICATOR, PkAuthenticator.class);
     }
 
     public void setPkAuthenticator(PkAuthenticator pkAuthenticator) {
-        setFieldAs(PK_AUTHENTICATOR, pkAuthenticator);
+        setFieldAs(AuthPackField.PK_AUTHENTICATOR, pkAuthenticator);
     }
 
     public SubjectPublicKeyInfo getClientPublicValue() {
-        return getFieldAs(CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class);
+        return getFieldAs(AuthPackField.CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class);
     }
 
     public void setClientPublicValue(SubjectPublicKeyInfo clientPublicValue) {
-        setFieldAs(CLIENT_PUBLIC_VALUE, clientPublicValue);
+        setFieldAs(AuthPackField.CLIENT_PUBLIC_VALUE, clientPublicValue);
     }
 
     public AlgorithmIdentifiers getsupportedCmsTypes() {
-        return getFieldAs(SUPPORTED_CMS_TYPES, AlgorithmIdentifiers.class);
+        return getFieldAs(AuthPackField.SUPPORTED_CMS_TYPES, AlgorithmIdentifiers.class);
     }
 
     public void setsupportedCmsTypes(AlgorithmIdentifiers supportedCMSTypes) {
-        setFieldAs(SUPPORTED_CMS_TYPES, supportedCMSTypes);
+        setFieldAs(AuthPackField.SUPPORTED_CMS_TYPES, supportedCMSTypes);
     }
 
     public DHNonce getClientDhNonce() {
-        return getFieldAs(CLIENT_DH_NONCE, DHNonce.class);
+        return getFieldAs(AuthPackField.CLIENT_DH_NONCE, DHNonce.class);
     }
 
     public void setClientDhNonce(DHNonce dhNonce) {
-        setFieldAs(CLIENT_DH_NONCE, dhNonce);
+        setFieldAs(AuthPackField.CLIENT_DH_NONCE, dhNonce);
     }
 
     public SupportedKDFs getsupportedKDFs() {
-        return getFieldAs(SUPPORTED_KDFS, SupportedKDFs.class);
+        return getFieldAs(AuthPackField.SUPPORTED_KDFS, SupportedKDFs.class);
     }
 
     public void setsupportedKDFs(SupportedKDFs supportedKDFs) {
-        setFieldAs(SUPPORTED_KDFS, supportedKDFs);
+        setFieldAs(AuthPackField.SUPPORTED_KDFS, supportedKDFs);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHRepInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHRepInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHRepInfo.java
index 8803638..853fe65 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHRepInfo.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHRepInfo.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHRepInfo.MyEnum.*;
-
 /**
  DHRepInfo ::= SEQUENCE {
     dhSignedData            [0] IMPLICIT OCTET STRING,
@@ -36,7 +34,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHRepInfo.MyEnum.*;
  }
  */
 public class DHRepInfo extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum DHRepInfoField implements EnumType {
         DH_SIGNED_DATA,
         SERVER_DH_NONCE,
         KDF_ID;
@@ -53,9 +51,9 @@ public class DHRepInfo extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ImplicitField(DH_SIGNED_DATA, Asn1OctetString.class),
-            new ExplicitField(SERVER_DH_NONCE, DHNonce.class),
-            new ExplicitField(KDF_ID, Asn1ObjectIdentifier.class)
+            new ImplicitField(DHRepInfoField.DH_SIGNED_DATA, Asn1OctetString.class),
+            new ExplicitField(DHRepInfoField.SERVER_DH_NONCE, DHNonce.class),
+            new ExplicitField(DHRepInfoField.KDF_ID, Asn1ObjectIdentifier.class)
     };
 
     public DHRepInfo() {
@@ -63,26 +61,26 @@ public class DHRepInfo extends KrbSequenceType {
     }
 
     public byte[] getDHSignedData() {
-        return getFieldAsOctets(DH_SIGNED_DATA);
+        return getFieldAsOctets(DHRepInfoField.DH_SIGNED_DATA);
     }
 
     public void setDHSignedData(byte[] dhSignedData) {
-        setFieldAsOctets(DH_SIGNED_DATA, dhSignedData);
+        setFieldAsOctets(DHRepInfoField.DH_SIGNED_DATA, dhSignedData);
     }
 
     public DHNonce getServerDhNonce() {
-        return getFieldAs(SERVER_DH_NONCE, DHNonce.class);
+        return getFieldAs(DHRepInfoField.SERVER_DH_NONCE, DHNonce.class);
     }
 
     public void setServerDhNonce(DHNonce dhNonce) {
-        setFieldAs(SERVER_DH_NONCE, dhNonce);
+        setFieldAs(DHRepInfoField.SERVER_DH_NONCE, dhNonce);
     }
 
     public Asn1ObjectIdentifier getKdfId() {
-        return getFieldAs(KDF_ID, Asn1ObjectIdentifier.class);
+        return getFieldAs(DHRepInfoField.KDF_ID, Asn1ObjectIdentifier.class);
     }
 
     public void setKdfId(Asn1ObjectIdentifier kdfId) {
-        setFieldAs(KDF_ID, kdfId);
+        setFieldAs(DHRepInfoField.KDF_ID, kdfId);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ExternalPrincipalIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ExternalPrincipalIdentifier.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ExternalPrincipalIdentifier.java
index 111fb93..665c57a 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ExternalPrincipalIdentifier.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ExternalPrincipalIdentifier.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.ExternalPrincipalIdentifier.MyEnum.*;
-
 /**
  ExternalPrincipalIdentifier ::= SEQUENCE {
      subjectName             [0] IMPLICIT OCTET STRING OPTIONAL,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.ExternalPrincipalIde
  }
  */
 public class ExternalPrincipalIdentifier extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ExternalPrincipalIdentifierField implements EnumType {
         SUBJECT_NAME,
         ISSUER_AND_SERIAL_NUMBER,
         SUBJECT_KEY_IDENTIFIER;
@@ -52,9 +50,9 @@ public class ExternalPrincipalIdentifier extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ImplicitField(SUBJECT_NAME, Asn1OctetString.class),
-            new ImplicitField(ISSUER_AND_SERIAL_NUMBER, Asn1OctetString.class),
-            new ImplicitField(SUBJECT_KEY_IDENTIFIER, Asn1OctetString.class)
+            new ImplicitField(ExternalPrincipalIdentifierField.SUBJECT_NAME, Asn1OctetString.class),
+            new ImplicitField(ExternalPrincipalIdentifierField.ISSUER_AND_SERIAL_NUMBER, Asn1OctetString.class),
+            new ImplicitField(ExternalPrincipalIdentifierField.SUBJECT_KEY_IDENTIFIER, Asn1OctetString.class)
     };
 
     public ExternalPrincipalIdentifier() {
@@ -62,26 +60,26 @@ public class ExternalPrincipalIdentifier extends KrbSequenceType {
     }
 
     public byte[] getSubjectName() {
-        return getFieldAsOctets(SUBJECT_NAME);
+        return getFieldAsOctets(ExternalPrincipalIdentifierField.SUBJECT_NAME);
     }
 
     public void setSubjectName(byte[] subjectName) {
-        setFieldAsOctets(SUBJECT_NAME, subjectName);
+        setFieldAsOctets(ExternalPrincipalIdentifierField.SUBJECT_NAME, subjectName);
     }
 
     public byte[] getIssuerSerialNumber() {
-        return getFieldAsOctets(ISSUER_AND_SERIAL_NUMBER);
+        return getFieldAsOctets(ExternalPrincipalIdentifierField.ISSUER_AND_SERIAL_NUMBER);
     }
 
     public void setIssuerSerialNumber(byte[] issuerSerialNumber) {
-        setFieldAsOctets(ISSUER_AND_SERIAL_NUMBER, issuerSerialNumber);
+        setFieldAsOctets(ExternalPrincipalIdentifierField.ISSUER_AND_SERIAL_NUMBER, issuerSerialNumber);
     }
 
     public byte[] getSubjectKeyIdentifier() {
-        return getFieldAsOctets(SUBJECT_KEY_IDENTIFIER);
+        return getFieldAsOctets(ExternalPrincipalIdentifierField.SUBJECT_KEY_IDENTIFIER);
     }
 
     public void setSubjectKeyIdentifier(byte[] subjectKeyIdentifier) {
-        setFieldAsOctets(SUBJECT_KEY_IDENTIFIER, subjectKeyIdentifier);
+        setFieldAsOctets(ExternalPrincipalIdentifierField.SUBJECT_KEY_IDENTIFIER, subjectKeyIdentifier);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/KdcDHKeyInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/KdcDHKeyInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/KdcDHKeyInfo.java
index b5d3a73..4f66a15 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/KdcDHKeyInfo.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/KdcDHKeyInfo.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDHKeyInfo.MyEnum.*;
-
 /**
  KDCDHKeyInfo ::= SEQUENCE {
     subjectPublicKey        [0] BIT STRING,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDHKeyInfo.MyEnum.
  }
  */
 public class KdcDHKeyInfo extends KrbSequenceType {
-    protected static enum MyEnum implements EnumType {
+    protected static enum KdcDHKeyInfoField implements EnumType {
         SUBJECT_PUBLIC_KEY,
         NONCE,
         DH_KEY_EXPIRATION;
@@ -54,9 +52,9 @@ public class KdcDHKeyInfo extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(SUBJECT_PUBLIC_KEY, Asn1BitString.class),
-            new ExplicitField(NONCE, Asn1Integer.class),
-            new ExplicitField(DH_KEY_EXPIRATION, KerberosTime.class)
+            new ExplicitField(KdcDHKeyInfoField.SUBJECT_PUBLIC_KEY, Asn1BitString.class),
+            new ExplicitField(KdcDHKeyInfoField.NONCE, Asn1Integer.class),
+            new ExplicitField(KdcDHKeyInfoField.DH_KEY_EXPIRATION, KerberosTime.class)
     };
 
     public KdcDHKeyInfo() {
@@ -64,26 +62,26 @@ public class KdcDHKeyInfo extends KrbSequenceType {
     }
 
     public Asn1BitString getSubjectPublicKey() {
-        return getFieldAs(SUBJECT_PUBLIC_KEY, Asn1BitString.class);
+        return getFieldAs(KdcDHKeyInfoField.SUBJECT_PUBLIC_KEY, Asn1BitString.class);
     }
 
     public void setSubjectPublicKey(byte[] subjectPubKey) {
-        setFieldAs(SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey));
+        setFieldAs(KdcDHKeyInfoField.SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey));
     }
 
     public int getNonce() {
-        return getFieldAsInt(NONCE);
+        return getFieldAsInt(KdcDHKeyInfoField.NONCE);
     }
 
     public void setNonce(int nonce) {
-        setFieldAsInt(NONCE, nonce);
+        setFieldAsInt(KdcDHKeyInfoField.NONCE, nonce);
     }
 
     public KerberosTime getDHKeyExpiration() {
-        return getFieldAsTime(DH_KEY_EXPIRATION);
+        return getFieldAsTime(KdcDHKeyInfoField.DH_KEY_EXPIRATION);
     }
 
     public void setDHKeyExpiration(KerberosTime time) {
-        setFieldAs(DH_KEY_EXPIRATION, time);
+        setFieldAs(KdcDHKeyInfoField.DH_KEY_EXPIRATION, time);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/Krb5PrincipalName.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/Krb5PrincipalName.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/Krb5PrincipalName.java
index c065332..d85147c 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/Krb5PrincipalName.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/Krb5PrincipalName.java
@@ -26,8 +26,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 import org.apache.kerby.kerberos.kerb.type.base.Realm;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.Krb5PrincipalName.MyEnum.*;
-
 /**
  KRB5PrincipalName ::= SEQUENCE {
      realm                   [0] Realm,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.Krb5PrincipalName.My
  }
  */
 public class Krb5PrincipalName extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum Krb5PrincipalNameField implements EnumType {
         REALM,
         PRINCIPAL_NAME;
 
@@ -51,8 +49,8 @@ public class Krb5PrincipalName extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(REALM, Realm.class),
-            new ExplicitField(PRINCIPAL_NAME, PrincipalName.class)
+            new ExplicitField(Krb5PrincipalNameField.REALM, Realm.class),
+            new ExplicitField(Krb5PrincipalNameField.PRINCIPAL_NAME, PrincipalName.class)
     };
 
     public Krb5PrincipalName() {
@@ -60,18 +58,18 @@ public class Krb5PrincipalName extends KrbSequenceType {
     }
 
     public String getRelm() {
-        return getFieldAsString(REALM);
+        return getFieldAsString(Krb5PrincipalNameField.REALM);
     }
 
     public void setRealm(String realm) {
-        setFieldAsString(REALM, realm);
+        setFieldAsString(Krb5PrincipalNameField.REALM, realm);
     }
 
     public PrincipalName getPrincipalName() {
-        return getFieldAs(PRINCIPAL_NAME, PrincipalName.class);
+        return getFieldAs(Krb5PrincipalNameField.PRINCIPAL_NAME, PrincipalName.class);
     }
 
     public void setPrincipalName(PrincipalName principalName) {
-        setFieldAs(PRINCIPAL_NAME, principalName);
+        setFieldAs(Krb5PrincipalNameField.PRINCIPAL_NAME, principalName);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsRep.java
index 0c20370..9d835ec 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsRep.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsRep.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsRep.MyEnum.*;
-
 /**
  PA-PK-AS-REP ::= CHOICE {
     dhInfo                  [0] DHRepInfo,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsRep.MyEnum.*;
  }
  */
 public class PaPkAsRep extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum PaPkAsRepField implements EnumType {
         DH_INFO,
         ENCKEY_PACK;
 
@@ -51,8 +49,8 @@ public class PaPkAsRep extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(DH_INFO, DHRepInfo.class),
-            new ImplicitField(ENCKEY_PACK, Asn1OctetString.class)
+            new ExplicitField(PaPkAsRepField.DH_INFO, DHRepInfo.class),
+            new ImplicitField(PaPkAsRepField.ENCKEY_PACK, Asn1OctetString.class)
     };
 
     public PaPkAsRep() {
@@ -60,18 +58,18 @@ public class PaPkAsRep extends Asn1Choice {
     }
 
     public DHRepInfo getDHRepInfo() {
-        return getChoiceValueAs(DH_INFO, DHRepInfo.class);
+        return getChoiceValueAs(PaPkAsRepField.DH_INFO, DHRepInfo.class);
     }
 
     public void setDHRepInfo(DHRepInfo dhRepInfo) {
-        setChoiceValue(DH_INFO, dhRepInfo);
+        setChoiceValue(PaPkAsRepField.DH_INFO, dhRepInfo);
     }
 
     public byte[] getEncKeyPack() {
-        return getChoiceValueAsOctets(ENCKEY_PACK);
+        return getChoiceValueAsOctets(PaPkAsRepField.ENCKEY_PACK);
     }
 
     public void setEncKeyPack(byte[] encKeyPack) {
-        setChoiceValueAsOctets(ENCKEY_PACK, encKeyPack);
+        setChoiceValueAsOctets(PaPkAsRepField.ENCKEY_PACK, encKeyPack);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsReq.java
index 9f3bf00..5867561 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsReq.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PaPkAsReq.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq.MyEnum.*;
-
 /**
  PA-PK-AS-REQ ::= SEQUENCE {
      signedAuthPack          [0] IMPLICIT OCTET STRING,
@@ -36,7 +34,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq.MyEnum.*;
  }
  */
 public class PaPkAsReq extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaPkAsReqField implements EnumType {
         SIGNED_AUTH_PACK,
         TRUSTED_CERTIFIERS,
         KDC_PKID;
@@ -53,9 +51,9 @@ public class PaPkAsReq extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ImplicitField(SIGNED_AUTH_PACK, Asn1OctetString.class),
-            new ExplicitField(TRUSTED_CERTIFIERS, TrustedCertifiers.class),
-            new ImplicitField(KDC_PKID, Asn1OctetString.class)
+            new ImplicitField(PaPkAsReqField.SIGNED_AUTH_PACK, Asn1OctetString.class),
+            new ExplicitField(PaPkAsReqField.TRUSTED_CERTIFIERS, TrustedCertifiers.class),
+            new ImplicitField(PaPkAsReqField.KDC_PKID, Asn1OctetString.class)
     };
 
     public PaPkAsReq() {
@@ -63,26 +61,26 @@ public class PaPkAsReq extends KrbSequenceType {
     }
 
     public byte[] getSignedAuthPack() {
-        return getFieldAsOctets(SIGNED_AUTH_PACK);
+        return getFieldAsOctets(PaPkAsReqField.SIGNED_AUTH_PACK);
     }
 
     public void setSignedAuthPack(byte[] signedAuthPack) {
-        setFieldAsOctets(SIGNED_AUTH_PACK, signedAuthPack);
+        setFieldAsOctets(PaPkAsReqField.SIGNED_AUTH_PACK, signedAuthPack);
     }
 
     public TrustedCertifiers getTrustedCertifiers() {
-        return getFieldAs(TRUSTED_CERTIFIERS, TrustedCertifiers.class);
+        return getFieldAs(PaPkAsReqField.TRUSTED_CERTIFIERS, TrustedCertifiers.class);
     }
 
     public void setTrustedCertifiers(TrustedCertifiers trustedCertifiers) {
-        setFieldAs(TRUSTED_CERTIFIERS, trustedCertifiers);
+        setFieldAs(PaPkAsReqField.TRUSTED_CERTIFIERS, trustedCertifiers);
     }
 
     public byte[] getKdcPkId() {
-        return getFieldAsOctets(KDC_PKID);
+        return getFieldAsOctets(PaPkAsReqField.KDC_PKID);
     }
 
     public void setKdcPkId(byte[] kdcPkId) {
-        setFieldAsOctets(KDC_PKID, kdcPkId);
+        setFieldAsOctets(PaPkAsReqField.KDC_PKID, kdcPkId);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PkAuthenticator.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PkAuthenticator.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PkAuthenticator.java
index 12d4671..63d2ab7 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PkAuthenticator.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/PkAuthenticator.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PkAuthenticator.MyEnum.*;
-
 /**
  PKAuthenticator ::= SEQUENCE {
      cusec                   [0] INTEGER (0..999999),
@@ -45,7 +43,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.PkAuthenticator.MyEn
  }
  */
 public class PkAuthenticator extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PkAuthenticatorField implements EnumType {
         CUSEC,
         CTIME,
         NONCE,
@@ -63,10 +61,10 @@ public class PkAuthenticator extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(CUSEC, Asn1Integer.class),
-            new ExplicitField(CTIME, KerberosTime.class),
-            new ExplicitField(NONCE, Asn1Integer.class),
-            new ExplicitField(PA_CHECKSUM, Asn1OctetString.class)
+            new ExplicitField(PkAuthenticatorField.CUSEC, Asn1Integer.class),
+            new ExplicitField(PkAuthenticatorField.CTIME, KerberosTime.class),
+            new ExplicitField(PkAuthenticatorField.NONCE, Asn1Integer.class),
+            new ExplicitField(PkAuthenticatorField.PA_CHECKSUM, Asn1OctetString.class)
     };
 
     public PkAuthenticator() {
@@ -74,34 +72,34 @@ public class PkAuthenticator extends KrbSequenceType {
     }
 
     public int getCusec() {
-        return getFieldAsInt(CUSEC);
+        return getFieldAsInt(PkAuthenticatorField.CUSEC);
     }
 
     public void setCusec(int cusec) {
-        setFieldAsInt(CUSEC, cusec);
+        setFieldAsInt(PkAuthenticatorField.CUSEC, cusec);
     }
 
     public KerberosTime getCtime() {
-        return getFieldAsTime(CTIME);
+        return getFieldAsTime(PkAuthenticatorField.CTIME);
     }
 
     public void setCtime(KerberosTime ctime) {
-        setFieldAs(CTIME, ctime);
+        setFieldAs(PkAuthenticatorField.CTIME, ctime);
     }
 
     public int getNonce() {
-        return getFieldAsInt(NONCE);
+        return getFieldAsInt(PkAuthenticatorField.NONCE);
     }
 
     public void setNonce(int nonce) {
-        setFieldAsInt(NONCE, nonce);
+        setFieldAsInt(PkAuthenticatorField.NONCE, nonce);
     }
 
     public byte[] getPaChecksum() {
-        return getFieldAsOctets(PA_CHECKSUM);
+        return getFieldAsOctets(PkAuthenticatorField.PA_CHECKSUM);
     }
 
     public void setPaChecksum(byte[] paChecksum) {
-        setFieldAsOctets(PA_CHECKSUM, paChecksum);
+        setFieldAsOctets(PkAuthenticatorField.PA_CHECKSUM, paChecksum);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ReplyKeyPack.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ReplyKeyPack.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ReplyKeyPack.java
index 701afd6..21c652e 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ReplyKeyPack.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/ReplyKeyPack.java
@@ -26,8 +26,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.CheckSum;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.ReplyKeyPack.MyEnum.*;
-
 /**
  ReplyKeyPack ::= SEQUENCE {
     replyKey                [0] EncryptionKey,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.pkinit.ReplyKeyPack.MyEnum.
  }
  */
 public class ReplyKeyPack extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ReplyKeyPackField implements EnumType {
         REPLY_KEY,
         AS_CHECKSUM;
 
@@ -51,8 +49,8 @@ public class ReplyKeyPack extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(REPLY_KEY, EncryptionKey.class),
-            new ExplicitField(AS_CHECKSUM, CheckSum.class)
+            new ExplicitField(ReplyKeyPackField.REPLY_KEY, EncryptionKey.class),
+            new ExplicitField(ReplyKeyPackField.AS_CHECKSUM, CheckSum.class)
     };
 
     public ReplyKeyPack() {
@@ -60,18 +58,18 @@ public class ReplyKeyPack extends KrbSequenceType {
     }
 
     public EncryptionKey getReplyKey() {
-        return getFieldAs(REPLY_KEY, EncryptionKey.class);
+        return getFieldAs(ReplyKeyPackField.REPLY_KEY, EncryptionKey.class);
     }
 
     public void setReplyKey(EncryptionKey replyKey) {
-        setFieldAs(REPLY_KEY, replyKey);
+        setFieldAs(ReplyKeyPackField.REPLY_KEY, replyKey);
     }
 
     public CheckSum getAsChecksum() {
-        return getFieldAs(AS_CHECKSUM, CheckSum.class);
+        return getFieldAs(ReplyKeyPackField.AS_CHECKSUM, CheckSum.class);
     }
 
     public void setAsChecksum(CheckSum checkSum) {
-        setFieldAs(AS_CHECKSUM, checkSum);
+        setFieldAs(ReplyKeyPackField.AS_CHECKSUM, checkSum);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenChallenge.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenChallenge.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenChallenge.java
index 7a3b944..e6f3640 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenChallenge.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenChallenge.java
@@ -24,15 +24,13 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.token.PaTokenChallenge.MyEnum.*;
-
 /**
  PA-TOKEN-CHALLENGE ::= SEQUENCE {
     tokenInfos       [0] SEQUENCE (SIZE(1..MAX)) OF TokenInfo,
  }
 */
 public class PaTokenChallenge extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaTokenChallengeField implements EnumType {
         TOKENINFOS;
 
         @Override
@@ -47,7 +45,7 @@ public class PaTokenChallenge extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(TOKENINFOS, TokenInfos.class)
+            new ExplicitField(PaTokenChallengeField.TOKENINFOS, TokenInfos.class)
     };
 
     public PaTokenChallenge() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenRequest.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenRequest.java
index 6379506..7819f16 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenRequest.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/PaTokenRequest.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.KrbToken;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.token.PaTokenRequest.MyEnum.*;
-
 /**
  PA-TOKEN-REQUEST ::= SEQUENCE {
     token          [0]  OCTET STRING,
@@ -34,7 +32,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.token.PaTokenRequest.MyEnum
  }
 */
 public class PaTokenRequest extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PaTokenRequestField implements EnumType {
         TOKEN_INFO,
         TOKEN;
 
@@ -50,8 +48,8 @@ public class PaTokenRequest extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(TOKEN_INFO, TokenInfo.class),
-            new ExplicitField(TOKEN, KrbToken.class)
+            new ExplicitField(PaTokenRequestField.TOKEN_INFO, TokenInfo.class),
+            new ExplicitField(PaTokenRequestField.TOKEN, KrbToken.class)
     };
 
     public PaTokenRequest() {
@@ -59,19 +57,18 @@ public class PaTokenRequest extends KrbSequenceType {
     }
 
     public KrbToken getToken() {
-        return getFieldAs(TOKEN, KrbToken.class);
+        return getFieldAs(PaTokenRequestField.TOKEN, KrbToken.class);
     }
 
     public void setToken(KrbToken token) {
-        setFieldAs(TOKEN, token);
+        setFieldAs(PaTokenRequestField.TOKEN, token);
     }
 
     public TokenInfo getTokenInfo() {
-        return getFieldAs(TOKEN_INFO, TokenInfo.class);
+        return getFieldAs(PaTokenRequestField.TOKEN_INFO, TokenInfo.class);
     }
 
     public void setTokenInfo(TokenInfo tokenInfo) {
-        setFieldAs(TOKEN_INFO, tokenInfo);
+        setFieldAs(PaTokenRequestField.TOKEN_INFO, tokenInfo);
     }
-
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/TokenInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/TokenInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/TokenInfo.java
index 3c03824..6aa1665 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/TokenInfo.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/token/TokenInfo.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.asn1.type.Asn1Utf8String;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.pa.token.TokenInfo.MyEnum.*;
-
 /**
  TokenInfo ::= SEQUENCE {
     flags            [0] TokenFlags,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.pa.token.TokenInfo.MyEnum.*;
  }
  */
 public class TokenInfo extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum TokenInfoField implements EnumType {
         FLAGS,
         TOKEN_VENDOR;
 
@@ -51,8 +49,8 @@ public class TokenInfo extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(FLAGS, Asn1OctetString.class),
-            new ExplicitField(TOKEN_VENDOR, Asn1Utf8String.class),
+            new ExplicitField(TokenInfoField.FLAGS, Asn1OctetString.class),
+            new ExplicitField(TokenInfoField.TOKEN_VENDOR, Asn1Utf8String.class),
     };
 
     public TokenInfo() {
@@ -60,19 +58,19 @@ public class TokenInfo extends KrbSequenceType {
     }
 
     public TokenFlags getFlags() {
-        return getFieldAs(FLAGS, TokenFlags.class);
+        return getFieldAs(TokenInfoField.FLAGS, TokenFlags.class);
     }
 
     public void setFlags(TokenFlags flags) {
-        setFieldAs(FLAGS, flags);
+        setFieldAs(TokenInfoField.FLAGS, flags);
     }
 
     public String getTokenVendor() {
-        return getFieldAsString(TOKEN_VENDOR);
+        return getFieldAsString(TokenInfoField.TOKEN_VENDOR);
     }
 
     public void setTokenVendor(String tokenVendor) {
-        setFieldAs(TOKEN_VENDOR, new Asn1Utf8String(tokenVendor));
+        setFieldAs(TokenInfoField.TOKEN_VENDOR, new Asn1Utf8String(tokenVendor));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/EncTicketPart.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/EncTicketPart.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/EncTicketPart.java
index e9dfd06..9428630 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/EncTicketPart.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/EncTicketPart.java
@@ -31,8 +31,6 @@ import org.apache.kerby.kerberos.kerb.type.base.HostAddresses;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 import org.apache.kerby.kerberos.kerb.type.base.TransitedEncoding;
 
-import static org.apache.kerby.kerberos.kerb.type.ticket.EncTicketPart.MyEnum.*;
-
 /**
  -- Encrypted part of ticket
  EncTicketPart   ::= [APPLICATION 3] SEQUENCE {
@@ -52,7 +50,7 @@ import static org.apache.kerby.kerberos.kerb.type.ticket.EncTicketPart.MyEnum.*;
 public class EncTicketPart extends KrbAppSequenceType {
     public static final int TAG = 3;
 
-    protected enum MyEnum implements EnumType {
+    protected enum EncTicketPartField implements EnumType {
         FLAGS,
         KEY,
         CREALM,
@@ -77,17 +75,17 @@ public class EncTicketPart extends KrbAppSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(FLAGS, 0, TicketFlags.class),
-            new ExplicitField(KEY, 1, EncryptionKey.class),
-            new ExplicitField(CREALM, 2, KerberosString.class),
-            new ExplicitField(CNAME, 3, PrincipalName.class),
-            new ExplicitField(TRANSITED, 4, TransitedEncoding.class),
-            new ExplicitField(AUTHTIME, 5, KerberosTime.class),
-            new ExplicitField(STARTTIME, 6, KerberosTime.class),
-            new ExplicitField(ENDTIME, 7, KerberosTime.class),
-            new ExplicitField(ENDTIME, 8, KerberosTime.class),
-            new ExplicitField(CADDR, 9, HostAddresses.class),
-            new ExplicitField(AUTHORIZATION_DATA, 10, AuthorizationData.class)
+            new ExplicitField(EncTicketPartField.FLAGS, TicketFlags.class),
+            new ExplicitField(EncTicketPartField.KEY, EncryptionKey.class),
+            new ExplicitField(EncTicketPartField.CREALM, KerberosString.class),
+            new ExplicitField(EncTicketPartField.CNAME, PrincipalName.class),
+            new ExplicitField(EncTicketPartField.TRANSITED, TransitedEncoding.class),
+            new ExplicitField(EncTicketPartField.AUTHTIME, KerberosTime.class),
+            new ExplicitField(EncTicketPartField.STARTTIME, KerberosTime.class),
+            new ExplicitField(EncTicketPartField.ENDTIME, KerberosTime.class),
+            new ExplicitField(EncTicketPartField.ENDTIME, KerberosTime.class),
+            new ExplicitField(EncTicketPartField.CADDR, HostAddresses.class),
+            new ExplicitField(EncTicketPartField.AUTHORIZATION_DATA, AuthorizationData.class)
     };
 
     public EncTicketPart() {
@@ -95,90 +93,90 @@ public class EncTicketPart extends KrbAppSequenceType {
     }
 
     public TicketFlags getFlags() {
-        return getFieldAs(FLAGS, TicketFlags.class);
+        return getFieldAs(EncTicketPartField.FLAGS, TicketFlags.class);
     }
 
     public void setFlags(TicketFlags flags) {
-        setFieldAs(FLAGS, flags);
+        setFieldAs(EncTicketPartField.FLAGS, flags);
     }
 
     public EncryptionKey getKey() {
-        return getFieldAs(KEY, EncryptionKey.class);
+        return getFieldAs(EncTicketPartField.KEY, EncryptionKey.class);
     }
 
     public void setKey(EncryptionKey key) {
-        setFieldAs(KEY, key);
+        setFieldAs(EncTicketPartField.KEY, key);
     }
 
     public String getCrealm() {
-        return getFieldAsString(CREALM);
+        return getFieldAsString(EncTicketPartField.CREALM);
     }
 
     public void setCrealm(String crealm) {
-        setFieldAsString(CREALM, crealm);
+        setFieldAsString(EncTicketPartField.CREALM, crealm);
     }
 
     public PrincipalName getCname() {
-        return getFieldAs(CNAME, PrincipalName.class);
+        return getFieldAs(EncTicketPartField.CNAME, PrincipalName.class);
     }
 
     public void setCname(PrincipalName cname) {
-        setFieldAs(CNAME, cname);
+        setFieldAs(EncTicketPartField.CNAME, cname);
     }
 
     public TransitedEncoding getTransited() {
-        return getFieldAs(TRANSITED, TransitedEncoding.class);
+        return getFieldAs(EncTicketPartField.TRANSITED, TransitedEncoding.class);
     }
 
     public void setTransited(TransitedEncoding transited) {
-        setFieldAs(TRANSITED, transited);
+        setFieldAs(EncTicketPartField.TRANSITED, transited);
     }
 
     public KerberosTime getAuthTime() {
-        return getFieldAs(AUTHTIME, KerberosTime.class);
+        return getFieldAs(EncTicketPartField.AUTHTIME, KerberosTime.class);
     }
 
     public void setAuthTime(KerberosTime authTime) {
-        setFieldAs(AUTHTIME, authTime);
+        setFieldAs(EncTicketPartField.AUTHTIME, authTime);
     }
 
     public KerberosTime getStartTime() {
-        return getFieldAs(STARTTIME, KerberosTime.class);
+        return getFieldAs(EncTicketPartField.STARTTIME, KerberosTime.class);
     }
 
     public void setStartTime(KerberosTime startTime) {
-        setFieldAs(STARTTIME, startTime);
+        setFieldAs(EncTicketPartField.STARTTIME, startTime);
     }
 
     public KerberosTime getEndTime() {
-        return getFieldAs(ENDTIME, KerberosTime.class);
+        return getFieldAs(EncTicketPartField.ENDTIME, KerberosTime.class);
     }
 
     public void setEndTime(KerberosTime endTime) {
-        setFieldAs(ENDTIME, endTime);
+        setFieldAs(EncTicketPartField.ENDTIME, endTime);
     }
 
     public KerberosTime getRenewtill() {
-        return getFieldAs(RENEW_TILL, KerberosTime.class);
+        return getFieldAs(EncTicketPartField.RENEW_TILL, KerberosTime.class);
     }
 
     public void setRenewtill(KerberosTime renewtill) {
-        setFieldAs(RENEW_TILL, renewtill);
+        setFieldAs(EncTicketPartField.RENEW_TILL, renewtill);
     }
 
     public HostAddresses getClientAddresses() {
-        return getFieldAs(CADDR, HostAddresses.class);
+        return getFieldAs(EncTicketPartField.CADDR, HostAddresses.class);
     }
 
     public void setClientAddresses(HostAddresses clientAddresses) {
-        setFieldAs(CADDR, clientAddresses);
+        setFieldAs(EncTicketPartField.CADDR, clientAddresses);
     }
 
     public AuthorizationData getAuthorizationData() {
-        return getFieldAs(AUTHORIZATION_DATA, AuthorizationData.class);
+        return getFieldAs(EncTicketPartField.AUTHORIZATION_DATA, AuthorizationData.class);
     }
 
     public void setAuthorizationData(AuthorizationData authorizationData) {
-        setFieldAs(AUTHORIZATION_DATA, authorizationData);
+        setFieldAs(EncTicketPartField.AUTHORIZATION_DATA, authorizationData);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/Ticket.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/Ticket.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/Ticket.java
index 24bac5c..e0073b5 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/Ticket.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ticket/Ticket.java
@@ -29,8 +29,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbAppSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 
-import static org.apache.kerby.kerberos.kerb.type.ticket.Ticket.MyEnum.*;
-
 /**
  Ticket          ::= [APPLICATION 1] SEQUENCE {
  tkt-vno         [0] INTEGER (5),
@@ -43,7 +41,7 @@ public class Ticket extends KrbAppSequenceType {
     public static final int TKT_KVNO = KrbConstant.KRB_V5;
     public static final int TAG = 1;
 
-    protected enum MyEnum implements EnumType {
+    protected enum TicketField implements EnumType {
         TKT_VNO,
         REALM,
         SNAME,
@@ -61,10 +59,10 @@ public class Ticket extends KrbAppSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(TKT_VNO, 0, Asn1Integer.class),
-            new ExplicitField(REALM, 1, KerberosString.class),
-            new ExplicitField(SNAME, 2, PrincipalName.class),
-            new ExplicitField(ENC_PART, 3, EncryptedData.class)
+            new ExplicitField(TicketField.TKT_VNO, 0, Asn1Integer.class),
+            new ExplicitField(TicketField.REALM, 1, KerberosString.class),
+            new ExplicitField(TicketField.SNAME, 2, PrincipalName.class),
+            new ExplicitField(TicketField.ENC_PART, 3, EncryptedData.class)
     };
 
     public Ticket() {
@@ -75,34 +73,34 @@ public class Ticket extends KrbAppSequenceType {
     private EncTicketPart encPart;
 
     public int getTktvno() {
-        return getFieldAsInt(TKT_VNO);
+        return getFieldAsInt(TicketField.TKT_VNO);
     }
 
     public void setTktKvno(int kvno) {
-        setFieldAsInt(TKT_VNO, kvno);
+        setFieldAsInt(TicketField.TKT_VNO, kvno);
     }
     public PrincipalName getSname() {
-        return getFieldAs(SNAME, PrincipalName.class);
+        return getFieldAs(TicketField.SNAME, PrincipalName.class);
     }
 
     public void setSname(PrincipalName sname) {
-        setFieldAs(SNAME, sname);
+        setFieldAs(TicketField.SNAME, sname);
     }
 
     public String getRealm() {
-        return getFieldAsString(REALM);
+        return getFieldAsString(TicketField.REALM);
     }
 
     public void setRealm(String realm) {
-        setFieldAs(REALM, new KerberosString(realm));
+        setFieldAs(TicketField.REALM, new KerberosString(realm));
     }
 
     public EncryptedData getEncryptedEncPart() {
-        return getFieldAs(ENC_PART, EncryptedData.class);
+        return getFieldAs(TicketField.ENC_PART, EncryptedData.class);
     }
 
     public void setEncryptedEncPart(EncryptedData encryptedEncPart) {
-        setFieldAs(ENC_PART, encryptedEncPart);
+        setFieldAs(TicketField.ENC_PART, encryptedEncPart);
     }
 
     public EncTicketPart getEncPart() {


Mime
View raw message