directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [1/2] directory-kerby git commit: DIRKRB-516 Rename enum type in kerby-pkix/x509/type. Contributed by Yan.
Date Wed, 30 Dec 2015 03:29:51 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/trunk 2fdd50d3b -> c00bbc71f


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
index 6b0c6ef..dbf989d 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Boolean;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.IssuingDistributionPoint.MyEnum.*;
-
 /**
  * <pre>
  * IssuingDistributionPoint ::= SEQUENCE { 
@@ -40,7 +38,7 @@ import static org.apache.kerby.x509.type.IssuingDistributionPoint.MyEnum.*;
  * </pre>
  */
 public class IssuingDistributionPoint extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum IDPointField implements EnumType {
         DISTRIBUTION_POINT,
         ONLY_CONTAINS_USER_CERTS,
         ONLY_CONTAINS_CA_CERTS,
@@ -59,12 +57,12 @@ public class IssuingDistributionPoint extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(DISTRIBUTION_POINT, DistributionPointName.class),
-        new ExplicitField(ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class),
-        new ExplicitField(ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class),
-        new ExplicitField(ONLY_SOME_REASONS, ReasonFlags.class),
-        new ExplicitField(INDIRECT_CRL, Asn1Boolean.class),
-        new ExplicitField(ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class)
+        new ExplicitField(IDPointField.DISTRIBUTION_POINT, DistributionPointName.class),
+        new ExplicitField(IDPointField.ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class),
+        new ExplicitField(IDPointField.ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class),
+        new ExplicitField(IDPointField.ONLY_SOME_REASONS, ReasonFlags.class),
+        new ExplicitField(IDPointField.INDIRECT_CRL, Asn1Boolean.class),
+        new ExplicitField(IDPointField.ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class)
     };
 
     public IssuingDistributionPoint() {
@@ -72,50 +70,50 @@ public class IssuingDistributionPoint extends Asn1SequenceType {
     }
 
     public DistributionPointName getDistributionPoint() {
-        return getFieldAs(DISTRIBUTION_POINT, DistributionPointName.class);
+        return getFieldAs(IDPointField.DISTRIBUTION_POINT, DistributionPointName.class);
     }
 
     public void setDistributionPoint(DistributionPointName distributionPoint) {
-        setFieldAs(DISTRIBUTION_POINT, distributionPoint);
+        setFieldAs(IDPointField.DISTRIBUTION_POINT, distributionPoint);
     }
 
     public boolean getOnlyContainsUserCerts() {
-        return getFieldAs(ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class).getValue();
+        return getFieldAs(IDPointField.ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class).getValue();
     }
 
     public void setOnlyContainsUserCerts(boolean onlyContainsUserCerts) {
-        setFieldAs(ONLY_CONTAINS_USER_CERTS, new Asn1Boolean(onlyContainsUserCerts));
+        setFieldAs(IDPointField.ONLY_CONTAINS_USER_CERTS, new Asn1Boolean(onlyContainsUserCerts));
     }
 
     public boolean getOnlyContainsCACerts() {
-        return getFieldAs(ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class).getValue();
+        return getFieldAs(IDPointField.ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class).getValue();
     }
 
     public void setOnlyContainsCaCerts(boolean onlyContainsCaCerts) {
-        setFieldAs(ONLY_CONTAINS_CA_CERTS, new Asn1Boolean(onlyContainsCaCerts));
+        setFieldAs(IDPointField.ONLY_CONTAINS_CA_CERTS, new Asn1Boolean(onlyContainsCaCerts));
     }
 
     public ReasonFlags getOnlySomeReasons() {
-        return getFieldAs(ONLY_SOME_REASONS, ReasonFlags.class);
+        return getFieldAs(IDPointField.ONLY_SOME_REASONS, ReasonFlags.class);
     }
 
     public void setOnlySomeReasons(ReasonFlags onlySomeReasons) {
-        setFieldAs(ONLY_SOME_REASONS, onlySomeReasons);
+        setFieldAs(IDPointField.ONLY_SOME_REASONS, onlySomeReasons);
     }
 
     public boolean getIndirectCRL() {
-        return getFieldAs(INDIRECT_CRL, Asn1Boolean.class).getValue();
+        return getFieldAs(IDPointField.INDIRECT_CRL, Asn1Boolean.class).getValue();
     }
 
     public void setIndirectCrl(boolean indirectCrl) {
-        setFieldAs(INDIRECT_CRL, new Asn1Boolean(indirectCrl));
+        setFieldAs(IDPointField.INDIRECT_CRL, new Asn1Boolean(indirectCrl));
     }
 
     public boolean getOnlyContainsAttributeCerts() {
-        return getFieldAs(ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class).getValue();
+        return getFieldAs(IDPointField.ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class).getValue();
     }
 
     public void setOnlyContainsAttributeCerts(boolean onlyContainsAttributeCerts) {
-        setFieldAs(ONLY_CONTAINS_ATTRIBUTE_CERTS, new Asn1Boolean(onlyContainsAttributeCerts));
+        setFieldAs(IDPointField.ONLY_CONTAINS_ATTRIBUTE_CERTS, new Asn1Boolean(onlyContainsAttributeCerts));
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
index 34972df..7766801 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.NameConstraints.MyEnum.*;
-
 /*
  * NameConstraints ::= SEQUENCE {
  *     permittedSubtrees [0] GeneralSubtrees OPTIONAL,
@@ -33,7 +31,7 @@ import static org.apache.kerby.x509.type.NameConstraints.MyEnum.*;
  * }
  */
 public class NameConstraints extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum NameConstraintsField implements EnumType {
         PERMITTED_SUBTREES,
         EXCLUDED_SUBTREES;
 
@@ -49,8 +47,8 @@ public class NameConstraints extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(PERMITTED_SUBTREES, GeneralSubtrees.class),
-        new ExplicitField(EXCLUDED_SUBTREES, GeneralSubtrees.class)
+        new ExplicitField(NameConstraintsField.PERMITTED_SUBTREES, GeneralSubtrees.class),
+        new ExplicitField(NameConstraintsField.EXCLUDED_SUBTREES, GeneralSubtrees.class)
     };
 
     public NameConstraints() {
@@ -58,18 +56,18 @@ public class NameConstraints extends Asn1SequenceType {
     }
 
     public GeneralSubtrees getPermittedSubtrees() {
-        return getFieldAs(PERMITTED_SUBTREES, GeneralSubtrees.class);
+        return getFieldAs(NameConstraintsField.PERMITTED_SUBTREES, GeneralSubtrees.class);
     }
 
     public void setPermittedSubtrees(GeneralSubtrees permittedSubtrees) {
-        setFieldAs(PERMITTED_SUBTREES, permittedSubtrees);
+        setFieldAs(NameConstraintsField.PERMITTED_SUBTREES, permittedSubtrees);
     }
 
     public GeneralSubtrees getExcludedSubtrees() {
-        return getFieldAs(EXCLUDED_SUBTREES, GeneralSubtrees.class);
+        return getFieldAs(NameConstraintsField.EXCLUDED_SUBTREES, GeneralSubtrees.class);
     }
 
     public void setExcludedSubtrees(GeneralSubtrees excludedSubtrees) {
-        setFieldAs(EXCLUDED_SUBTREES, excludedSubtrees);
+        setFieldAs(NameConstraintsField.EXCLUDED_SUBTREES, excludedSubtrees);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
index 7c6dcb6..6f7ec32 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.NoticeReference.MyEnum.*;
-
 /**
  * <pre>
  *  NoticeReference ::= SEQUENCE {
@@ -36,7 +34,7 @@ import static org.apache.kerby.x509.type.NoticeReference.MyEnum.*;
  *
  */
 public class NoticeReference extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum NoticeReferenceField implements EnumType {
         ORGANIZATION,
         NOTICE_NUMBERS;
 
@@ -52,8 +50,8 @@ public class NoticeReference extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(ORGANIZATION, DisplayText.class),
-        new Asn1FieldInfo(NOTICE_NUMBERS, NoticeNumbers.class)
+        new Asn1FieldInfo(NoticeReferenceField.ORGANIZATION, DisplayText.class),
+        new Asn1FieldInfo(NoticeReferenceField.NOTICE_NUMBERS, NoticeNumbers.class)
     };
 
     public NoticeReference() {
@@ -61,18 +59,18 @@ public class NoticeReference extends Asn1SequenceType {
     }
 
     public DisplayText getOrganization() {
-        return getFieldAs(ORGANIZATION, DisplayText.class);
+        return getFieldAs(NoticeReferenceField.ORGANIZATION, DisplayText.class);
     }
 
     public void setOrganization(DisplayText organization) {
-        setFieldAs(ORGANIZATION, organization);
+        setFieldAs(NoticeReferenceField.ORGANIZATION, organization);
     }
 
     public NoticeNumbers getNoticeNumbers() {
-        return getFieldAs(NOTICE_NUMBERS, NoticeNumbers.class);
+        return getFieldAs(NoticeReferenceField.NOTICE_NUMBERS, NoticeNumbers.class);
     }
 
     public void setNoticeNumbers(NoticeNumbers noticeNumbers) {
-        setFieldAs(NOTICE_NUMBERS, noticeNumbers);
+        setFieldAs(NoticeReferenceField.NOTICE_NUMBERS, noticeNumbers);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
index bcbeaf9..b8534a1 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.type.Asn1BitString;
 import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.ObjectDigestInfo.MyEnum.*;
-
 /**
  *
  * <pre>
@@ -46,7 +44,7 @@ import static org.apache.kerby.x509.type.ObjectDigestInfo.MyEnum.*;
  * 
  */
 public class ObjectDigestInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ODInfoField implements EnumType {
         DIGESTED_OBJECT_TYPE,
         OTHER_OBJECT_TYPE_ID,
         DIGEST_ALGORITHM,
@@ -64,10 +62,10 @@ public class ObjectDigestInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(DIGESTED_OBJECT_TYPE, DigestedObjectType.class),
-        new Asn1FieldInfo(OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class),
-        new Asn1FieldInfo(DIGEST_ALGORITHM, AlgorithmIdentifier.class),
-        new Asn1FieldInfo(OBJECT_DIGEST, Asn1BitString.class)
+        new Asn1FieldInfo(ODInfoField.DIGESTED_OBJECT_TYPE, DigestedObjectType.class),
+        new Asn1FieldInfo(ODInfoField.OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class),
+        new Asn1FieldInfo(ODInfoField.DIGEST_ALGORITHM, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(ODInfoField.OBJECT_DIGEST, Asn1BitString.class)
     };
 
     public ObjectDigestInfo() {
@@ -75,34 +73,34 @@ public class ObjectDigestInfo extends Asn1SequenceType {
     }
 
     public DigestedObjectType getDigestedObjectType() {
-        return getFieldAs(DIGESTED_OBJECT_TYPE, DigestedObjectType.class);
+        return getFieldAs(ODInfoField.DIGESTED_OBJECT_TYPE, DigestedObjectType.class);
     }
 
     public void setDigestedObjectType(DigestedObjectType digestedObjectType) {
-        setFieldAs(DIGESTED_OBJECT_TYPE, digestedObjectType);
+        setFieldAs(ODInfoField.DIGESTED_OBJECT_TYPE, digestedObjectType);
     }
 
     public Asn1ObjectIdentifier getOtherObjectTypeID() {
-        return getFieldAs(OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class);
+        return getFieldAs(ODInfoField.OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class);
     }
 
     public void setOtherObjectTypeId(Asn1ObjectIdentifier otherObjectTypeID) {
-        setFieldAs(OTHER_OBJECT_TYPE_ID, otherObjectTypeID);
+        setFieldAs(ODInfoField.OTHER_OBJECT_TYPE_ID, otherObjectTypeID);
     }
 
     public AlgorithmIdentifier getDigestAlgorithm() {
-        return getFieldAs(DIGEST_ALGORITHM, AlgorithmIdentifier.class);
+        return getFieldAs(ODInfoField.DIGEST_ALGORITHM, AlgorithmIdentifier.class);
     }
 
     public void setDigestAlgorithm(AlgorithmIdentifier digestAlgorithm) {
-        setFieldAs(DIGEST_ALGORITHM, digestAlgorithm);
+        setFieldAs(ODInfoField.DIGEST_ALGORITHM, digestAlgorithm);
     }
 
     public Asn1BitString getObjectDigest() {
-        return getFieldAs(OBJECT_DIGEST, Asn1BitString.class);
+        return getFieldAs(ODInfoField.OBJECT_DIGEST, Asn1BitString.class);
     }
 
     public void setObjectDigest(Asn1BitString objectDigest) {
-        setFieldAs(OBJECT_DIGEST, objectDigest);
+        setFieldAs(ODInfoField.OBJECT_DIGEST, objectDigest);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
index b963411..847137e 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.asn1.type.Asn1Type;
 
-import static org.apache.kerby.x509.type.OtherName.MyEnum.*;
-
 /**
  * <pre>
  * OtherName ::= SEQUENCE {
@@ -39,7 +37,7 @@ import static org.apache.kerby.x509.type.OtherName.MyEnum.*;
  * </pre>
  */
 public class OtherName extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtherNameField implements EnumType {
         TYPE_ID,
         VALUE;
 
@@ -55,8 +53,8 @@ public class OtherName extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(TYPE_ID, Asn1ObjectIdentifier.class),
-            new ExplicitField(VALUE, 0, Asn1Any.class)
+            new Asn1FieldInfo(OtherNameField.TYPE_ID, Asn1ObjectIdentifier.class),
+            new ExplicitField(OtherNameField.VALUE, 0, Asn1Any.class)
     };
 
     public OtherName() {
@@ -64,18 +62,18 @@ public class OtherName extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getTypeId() {
-        return getFieldAs(TYPE_ID, Asn1ObjectIdentifier.class);
+        return getFieldAs(OtherNameField.TYPE_ID, Asn1ObjectIdentifier.class);
     }
 
     public void setTypeId(Asn1ObjectIdentifier algorithm) {
-        setFieldAs(TYPE_ID, algorithm);
+        setFieldAs(OtherNameField.TYPE_ID, algorithm);
     }
 
     public <T extends Asn1Type> T getOtherNameValueAs(Class<T> t) {
-        return getFieldAsAny(VALUE, t);
+        return getFieldAsAny(OtherNameField.VALUE, t);
     }
 
     public void setOtherNameValue(Asn1Type value) {
-        setFieldAsAny(VALUE, value);
+        setFieldAsAny(OtherNameField.VALUE, value);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
index 76d35e1..83ae28e 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.PolicyConstraints.MyEnum.*;
-
 /**
  * Ref. RFC 5280
  * <pre>
@@ -40,7 +38,7 @@ import static org.apache.kerby.x509.type.PolicyConstraints.MyEnum.*;
  * </pre>
  */
 public class PolicyConstraints extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PolicyConstraintsField implements EnumType {
         REQUIRE_EXPLICIT_POLICY,
         INHIBIT_POLICY_MAPPING;
 
@@ -56,8 +54,8 @@ public class PolicyConstraints extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(REQUIRE_EXPLICIT_POLICY, Asn1Integer.class),
-        new ExplicitField(INHIBIT_POLICY_MAPPING, Asn1Integer.class)
+        new ExplicitField(PolicyConstraintsField.REQUIRE_EXPLICIT_POLICY, Asn1Integer.class),
+        new ExplicitField(PolicyConstraintsField.INHIBIT_POLICY_MAPPING, Asn1Integer.class)
     };
 
     public PolicyConstraints() {
@@ -65,18 +63,18 @@ public class PolicyConstraints extends Asn1SequenceType {
     }
 
     public Asn1Integer getRequireExplicitPolicy() {
-        return getFieldAs(REQUIRE_EXPLICIT_POLICY, Asn1Integer.class);
+        return getFieldAs(PolicyConstraintsField.REQUIRE_EXPLICIT_POLICY, Asn1Integer.class);
     }
 
     public void setRequireExplicitPolicy(Asn1Integer requireExplicitPolicy) {
-        setFieldAs(REQUIRE_EXPLICIT_POLICY, requireExplicitPolicy);
+        setFieldAs(PolicyConstraintsField.REQUIRE_EXPLICIT_POLICY, requireExplicitPolicy);
     }
 
     public Asn1Integer getInhibitPolicyMapping() {
-        return getFieldAs(INHIBIT_POLICY_MAPPING, Asn1Integer.class);
+        return getFieldAs(PolicyConstraintsField.INHIBIT_POLICY_MAPPING, Asn1Integer.class);
     }
 
     public void setInhibitPolicyMapping(Asn1Integer inhibitPolicyMapping) {
-        setFieldAs(INHIBIT_POLICY_MAPPING, inhibitPolicyMapping);
+        setFieldAs(PolicyConstraintsField.INHIBIT_POLICY_MAPPING, inhibitPolicyMapping);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
index 3f6cbce..2627c44 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.PolicyInformation.MyEnum.*;
-
 /*
  * <pre>
  * PolicyInformation ::= SEQUENCE {
@@ -34,7 +32,7 @@ import static org.apache.kerby.x509.type.PolicyInformation.MyEnum.*;
  * </pre>
  */
 public class PolicyInformation extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PolicyInformationField implements EnumType {
         POLICY_IDENTIFIER,
         POLICY_QUALIFIERS;
 
@@ -50,8 +48,8 @@ public class PolicyInformation extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(POLICY_IDENTIFIER, CertPolicyId.class),
-        new Asn1FieldInfo(POLICY_QUALIFIERS, PolicyQualifierInfos.class)
+        new Asn1FieldInfo(PolicyInformationField.POLICY_IDENTIFIER, CertPolicyId.class),
+        new Asn1FieldInfo(PolicyInformationField.POLICY_QUALIFIERS, PolicyQualifierInfos.class)
     };
 
     public PolicyInformation() {
@@ -59,18 +57,18 @@ public class PolicyInformation extends Asn1SequenceType {
     }
 
     public CertPolicyId getPolicyIdentifier() {
-        return getFieldAs(POLICY_IDENTIFIER, CertPolicyId.class);
+        return getFieldAs(PolicyInformationField.POLICY_IDENTIFIER, CertPolicyId.class);
     }
 
     public void setPolicyIdentifier(CertPolicyId policyIdentifier) {
-        setFieldAs(POLICY_IDENTIFIER, policyIdentifier);
+        setFieldAs(PolicyInformationField.POLICY_IDENTIFIER, policyIdentifier);
     }
     
     public PolicyQualifierInfos getPolicyQualifiers() {
-        return getFieldAs(POLICY_QUALIFIERS, PolicyQualifierInfos.class);
+        return getFieldAs(PolicyInformationField.POLICY_QUALIFIERS, PolicyQualifierInfos.class);
     }
 
     public void setPolicyQualifiers(PolicyQualifierInfos policyQualifiers) {
-        setFieldAs(POLICY_QUALIFIERS, policyQualifiers);
+        setFieldAs(PolicyInformationField.POLICY_QUALIFIERS, policyQualifiers);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
index 69cc184..a7171f9 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.PolicyMapping.MyEnum.*;
-
 /**
  * Ref. RFC3280
  * <pre>
@@ -35,7 +33,7 @@ import static org.apache.kerby.x509.type.PolicyMapping.MyEnum.*;
  *
  */
 public class PolicyMapping extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PolicyMappingField implements EnumType {
         ISSUER_DOMAIN_POLICY,
         SUBJECT_DOMAIN_POLICY;
 
@@ -51,8 +49,8 @@ public class PolicyMapping extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(ISSUER_DOMAIN_POLICY, CertPolicyId.class),
-        new Asn1FieldInfo(SUBJECT_DOMAIN_POLICY, CertPolicyId.class)
+        new Asn1FieldInfo(PolicyMappingField.ISSUER_DOMAIN_POLICY, CertPolicyId.class),
+        new Asn1FieldInfo(PolicyMappingField.SUBJECT_DOMAIN_POLICY, CertPolicyId.class)
     };
 
     public PolicyMapping() {
@@ -60,18 +58,18 @@ public class PolicyMapping extends Asn1SequenceType {
     }
 
     public CertPolicyId getIssuerDomainPolicy() {
-        return  getFieldAs(ISSUER_DOMAIN_POLICY, CertPolicyId.class);
+        return  getFieldAs(PolicyMappingField.ISSUER_DOMAIN_POLICY, CertPolicyId.class);
     }
 
     public void setIssuerDomainPolicy(CertPolicyId issuerDomainPolicy) {
-        setFieldAs(ISSUER_DOMAIN_POLICY, issuerDomainPolicy);
+        setFieldAs(PolicyMappingField.ISSUER_DOMAIN_POLICY, issuerDomainPolicy);
     }
 
     public CertPolicyId getSubjectDomainPolicy() {
-        return getFieldAs(SUBJECT_DOMAIN_POLICY, CertPolicyId.class);
+        return getFieldAs(PolicyMappingField.SUBJECT_DOMAIN_POLICY, CertPolicyId.class);
     }
 
     public void setSubjectDomainPolicy(CertPolicyId subjectDomainPolicy) {
-        setFieldAs(SUBJECT_DOMAIN_POLICY, subjectDomainPolicy);
+        setFieldAs(PolicyMappingField.SUBJECT_DOMAIN_POLICY, subjectDomainPolicy);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
index 77e2de3..e470000 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.type.Asn1Any;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.asn1.type.Asn1Type;
 
-import static org.apache.kerby.x509.type.PolicyQualifierInfo.MyEnum.*;
-
 /**
  * 
  * <pre>
@@ -39,7 +37,7 @@ import static org.apache.kerby.x509.type.PolicyQualifierInfo.MyEnum.*;
  * </pre>
  */
 public class PolicyQualifierInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PolicyQualifierInfoField implements EnumType {
         POLICY_QUALIFIER_ID,
         QUALIFIER;
 
@@ -55,8 +53,8 @@ public class PolicyQualifierInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(POLICY_QUALIFIER_ID, PolicyQualifierId.class),
-        new Asn1FieldInfo(QUALIFIER, Asn1Any.class)
+        new Asn1FieldInfo(PolicyQualifierInfoField.POLICY_QUALIFIER_ID, PolicyQualifierId.class),
+        new Asn1FieldInfo(PolicyQualifierInfoField.QUALIFIER, Asn1Any.class)
     };
 
     public PolicyQualifierInfo() {
@@ -64,18 +62,18 @@ public class PolicyQualifierInfo extends Asn1SequenceType {
     }
 
     public PolicyQualifierId getPolicyQualifierId() {
-        return getFieldAs(POLICY_QUALIFIER_ID, PolicyQualifierId.class);
+        return getFieldAs(PolicyQualifierInfoField.POLICY_QUALIFIER_ID, PolicyQualifierId.class);
     }
 
     public void setPolicyQualifierId(PolicyQualifierId policyQualifierId) {
-        setFieldAs(POLICY_QUALIFIER_ID, policyQualifierId);
+        setFieldAs(PolicyQualifierInfoField.POLICY_QUALIFIER_ID, policyQualifierId);
     }
 
     public <T extends Asn1Type> T getQualifierAs(Class<T> t) {
-        return getFieldAsAny(QUALIFIER, t);
+        return getFieldAsAny(PolicyQualifierInfoField.QUALIFIER, t);
     }
 
     public void setQualifier(Asn1Type qualifier) {
-        setFieldAsAny(QUALIFIER, qualifier);
+        setFieldAsAny(PolicyQualifierInfoField.QUALIFIER, qualifier);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
index 3834535..b220d02 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1GeneralizedTime;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.PrivateKeyUsagePeriod.MyEnum.*;
-
 /**
  * <pre>
  *    PrivateKeyUsagePeriod ::= SEQUENCE {
@@ -36,7 +34,7 @@ import static org.apache.kerby.x509.type.PrivateKeyUsagePeriod.MyEnum.*;
  * </pre>
  */
 public class PrivateKeyUsagePeriod extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PrivateKeyUsagePeriodField implements EnumType {
         NOT_BEFORE,
         NOT_AFTER;
 
@@ -52,8 +50,8 @@ public class PrivateKeyUsagePeriod extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(NOT_BEFORE, Asn1GeneralizedTime.class),
-        new ExplicitField(NOT_AFTER, Asn1GeneralizedTime.class)
+        new ExplicitField(PrivateKeyUsagePeriodField.NOT_BEFORE, Asn1GeneralizedTime.class),
+        new ExplicitField(PrivateKeyUsagePeriodField.NOT_AFTER, Asn1GeneralizedTime.class)
     };
 
     public PrivateKeyUsagePeriod() {
@@ -61,18 +59,18 @@ public class PrivateKeyUsagePeriod extends Asn1SequenceType {
     }
 
     public Asn1GeneralizedTime getNotBeforeTime() {
-        return getFieldAs(NOT_BEFORE, Asn1GeneralizedTime.class);
+        return getFieldAs(PrivateKeyUsagePeriodField.NOT_BEFORE, Asn1GeneralizedTime.class);
     }
 
     public void setNotBeforeTime(Asn1GeneralizedTime notBeforeTime) {
-        setFieldAs(NOT_BEFORE, notBeforeTime);
+        setFieldAs(PrivateKeyUsagePeriodField.NOT_BEFORE, notBeforeTime);
     }
 
     public Asn1GeneralizedTime getNotAfterTime() {
-        return getFieldAs(NOT_AFTER, Asn1GeneralizedTime.class);
+        return getFieldAs(PrivateKeyUsagePeriodField.NOT_AFTER, Asn1GeneralizedTime.class);
     }
 
     public void setNotAfterTime(Asn1GeneralizedTime notAfterTime) {
-        setFieldAs(NOT_AFTER, notAfterTime);
+        setFieldAs(PrivateKeyUsagePeriodField.NOT_AFTER, notAfterTime);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
index 0fbbbca..e437b69 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.RevokedCertificate.MyEnum.*;
-
 /**
  * Ref. RFC 2459
  *
@@ -38,7 +36,7 @@ import static org.apache.kerby.x509.type.RevokedCertificate.MyEnum.*;
  * </pre>
  */
 public class RevokedCertificate extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum RevokedCertificateField implements EnumType {
         USER_CERTIFICATE,
         REVOCATION_DATA,
         CRL_ENTRY_EXTENSIONS;
@@ -55,9 +53,9 @@ public class RevokedCertificate extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(USER_CERTIFICATE, CertificateSerialNumber.class),
-        new Asn1FieldInfo(REVOCATION_DATA, Time.class),
-        new Asn1FieldInfo(CRL_ENTRY_EXTENSIONS, Extensions.class)
+        new Asn1FieldInfo(RevokedCertificateField.USER_CERTIFICATE, CertificateSerialNumber.class),
+        new Asn1FieldInfo(RevokedCertificateField.REVOCATION_DATA, Time.class),
+        new Asn1FieldInfo(RevokedCertificateField.CRL_ENTRY_EXTENSIONS, Extensions.class)
     };
 
     public RevokedCertificate() {
@@ -65,26 +63,26 @@ public class RevokedCertificate extends Asn1SequenceType {
     }
 
     public CertificateSerialNumber getUserCertificate() {
-        return getFieldAs(USER_CERTIFICATE, CertificateSerialNumber.class);
+        return getFieldAs(RevokedCertificateField.USER_CERTIFICATE, CertificateSerialNumber.class);
     }
 
     public void setUserCertificate(CertificateSerialNumber userCertificate) {
-        setFieldAs(USER_CERTIFICATE, userCertificate);
+        setFieldAs(RevokedCertificateField.USER_CERTIFICATE, userCertificate);
     }
 
     public Time getRevocationDate() {
-        return getFieldAs(REVOCATION_DATA, Time.class);
+        return getFieldAs(RevokedCertificateField.REVOCATION_DATA, Time.class);
     }
 
     public void setRevocationData(Time revocationData) {
-        setFieldAs(REVOCATION_DATA, revocationData);
+        setFieldAs(RevokedCertificateField.REVOCATION_DATA, revocationData);
     }
 
     public Extensions getCrlEntryExtensions() {
-        return getFieldAs(CRL_ENTRY_EXTENSIONS, Extensions.class);
+        return getFieldAs(RevokedCertificateField.CRL_ENTRY_EXTENSIONS, Extensions.class);
     }
 
     public void setCrlEntryExtensions(Extensions crlEntryExtensions) {
-        setFieldAs(CRL_ENTRY_EXTENSIONS, crlEntryExtensions);
+        setFieldAs(RevokedCertificateField.CRL_ENTRY_EXTENSIONS, crlEntryExtensions);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
index 157e14d..1761845 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.RoleSyntax.MyEnum.*;
-
 /**
  *Ref. RFC3281
  * <pre>
@@ -36,7 +34,7 @@ import static org.apache.kerby.x509.type.RoleSyntax.MyEnum.*;
  * </pre>
  */
 public class RoleSyntax extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum RoleSyntaxField implements EnumType {
         ROLE_AUTHORITY,
         ROLE_NAME;
 
@@ -52,8 +50,8 @@ public class RoleSyntax extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(ROLE_AUTHORITY, GeneralNames.class),
-        new ExplicitField(ROLE_NAME, GeneralName.class)
+        new ExplicitField(RoleSyntaxField.ROLE_AUTHORITY, GeneralNames.class),
+        new ExplicitField(RoleSyntaxField.ROLE_NAME, GeneralName.class)
     };
 
     public RoleSyntax() {
@@ -61,18 +59,18 @@ public class RoleSyntax extends Asn1SequenceType {
     }
 
     public GeneralNames getRoleAuthority() {
-        return getFieldAs(ROLE_AUTHORITY, GeneralNames.class);
+        return getFieldAs(RoleSyntaxField.ROLE_AUTHORITY, GeneralNames.class);
     }
 
     public void setRoleAuthority(GeneralNames roleAuthority) {
-        setFieldAs(ROLE_AUTHORITY, roleAuthority);
+        setFieldAs(RoleSyntaxField.ROLE_AUTHORITY, roleAuthority);
     }
 
     public GeneralName getRoleName() {
-        return getFieldAs(ROLE_NAME, GeneralName.class);
+        return getFieldAs(RoleSyntaxField.ROLE_NAME, GeneralName.class);
     }
 
     public void setRoleName(GeneralName roleName) {
-        setFieldAs(ROLE_NAME, roleName);
+        setFieldAs(RoleSyntaxField.ROLE_NAME, roleName);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/SubjectPublicKeyInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/SubjectPublicKeyInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/SubjectPublicKeyInfo.java
index eeea0ab..8c32b6f 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/SubjectPublicKeyInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/SubjectPublicKeyInfo.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1BitString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.SubjectPublicKeyInfo.MyEnum.*;
-
 /**
  * SubjectPublicKeyInfo  ::=  SEQUENCE  {
  *    algorithm            AlgorithmIdentifier,
@@ -33,7 +31,7 @@ import static org.apache.kerby.x509.type.SubjectPublicKeyInfo.MyEnum.*;
  * }
  */
 public class SubjectPublicKeyInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum SubjectPublicKeyInfoField implements EnumType {
         ALGORITHM,
         SUBJECT_PUBLIC_KEY;
 
@@ -49,8 +47,8 @@ public class SubjectPublicKeyInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(ALGORITHM, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(SUBJECT_PUBLIC_KEY, Asn1BitString.class)
+            new Asn1FieldInfo(SubjectPublicKeyInfoField.ALGORITHM, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(SubjectPublicKeyInfoField.SUBJECT_PUBLIC_KEY, Asn1BitString.class)
     };
 
     public SubjectPublicKeyInfo() {
@@ -58,18 +56,18 @@ public class SubjectPublicKeyInfo extends Asn1SequenceType {
     }
 
     public AlgorithmIdentifier getAlgorithm() {
-        return getFieldAs(ALGORITHM, AlgorithmIdentifier.class);
+        return getFieldAs(SubjectPublicKeyInfoField.ALGORITHM, AlgorithmIdentifier.class);
     }
 
     public void setAlgorithm(AlgorithmIdentifier algorithm) {
-        setFieldAs(ALGORITHM, algorithm);
+        setFieldAs(SubjectPublicKeyInfoField.ALGORITHM, algorithm);
     }
 
     public Asn1BitString getSubjectPubKey() {
-        return getFieldAs(SUBJECT_PUBLIC_KEY, Asn1BitString.class);
+        return getFieldAs(SubjectPublicKeyInfoField.SUBJECT_PUBLIC_KEY, Asn1BitString.class);
     }
 
     public void setSubjectPubKey(byte[] subjectPubKey) {
-        setFieldAs(SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey));
+        setFieldAs(SubjectPublicKeyInfoField.SUBJECT_PUBLIC_KEY, new Asn1BitString(subjectPubKey));
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertList.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertList.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertList.java
index 0628644..7ddb618 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertList.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertList.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x500.type.Name;
 
-import static org.apache.kerby.x509.type.TBSCertList.MyEnum.*;
-
 /**
  * Ref. RFC-2459
  * <pre>
@@ -50,7 +48,7 @@ import static org.apache.kerby.x509.type.TBSCertList.MyEnum.*;
  * </pre>
  */
 public class TBSCertList extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum TBSCertListField implements EnumType {
         VERSION,
         SIGNATURE,
         ISSUER,
@@ -71,13 +69,13 @@ public class TBSCertList extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(VERSION, Asn1Integer.class),
-        new Asn1FieldInfo(SIGNATURE, AlgorithmIdentifier.class),
-        new Asn1FieldInfo(ISSUER, Name.class),
-        new Asn1FieldInfo(THIS_UPDATA, Time.class),
-        new Asn1FieldInfo(NEXT_UPDATE, Time.class),
-        new Asn1FieldInfo(REVOKED_CERTIFICATES, RevokedCertificates.class),
-        new ExplicitField(CRL_EXTENSIONS, 0, Extensions.class)
+        new Asn1FieldInfo(TBSCertListField.VERSION, Asn1Integer.class),
+        new Asn1FieldInfo(TBSCertListField.SIGNATURE, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(TBSCertListField.ISSUER, Name.class),
+        new Asn1FieldInfo(TBSCertListField.THIS_UPDATA, Time.class),
+        new Asn1FieldInfo(TBSCertListField.NEXT_UPDATE, Time.class),
+        new Asn1FieldInfo(TBSCertListField.REVOKED_CERTIFICATES, RevokedCertificates.class),
+        new ExplicitField(TBSCertListField.CRL_EXTENSIONS, 0, Extensions.class)
     };
 
     public TBSCertList() {
@@ -85,58 +83,58 @@ public class TBSCertList extends Asn1SequenceType {
     }
 
     public Asn1Integer getVersion() {
-        return getFieldAs(VERSION, Asn1Integer.class);
+        return getFieldAs(TBSCertListField.VERSION, Asn1Integer.class);
     }
 
     public void setVersion(Asn1Integer version) {
-        setFieldAs(VERSION, version);
+        setFieldAs(TBSCertListField.VERSION, version);
     }
 
     public AlgorithmIdentifier getSignature() {
-        return getFieldAs(SIGNATURE, AlgorithmIdentifier.class);
+        return getFieldAs(TBSCertListField.SIGNATURE, AlgorithmIdentifier.class);
     }
 
     public void setSignature(AlgorithmIdentifier signature) {
-        setFieldAs(SIGNATURE, signature);
+        setFieldAs(TBSCertListField.SIGNATURE, signature);
     }
 
     public Name getIssuer() {
-        return getFieldAs(ISSUER, Name.class);
+        return getFieldAs(TBSCertListField.ISSUER, Name.class);
     }
 
     public void setIssuer(Name issuer) {
-        setFieldAs(ISSUER, issuer);
+        setFieldAs(TBSCertListField.ISSUER, issuer);
     }
 
     public Time getThisUpdate() {
-        return getFieldAs(THIS_UPDATA, Time.class);
+        return getFieldAs(TBSCertListField.THIS_UPDATA, Time.class);
     }
 
     public void setThisUpdata(Time thisUpdata) {
-        setFieldAs(THIS_UPDATA, thisUpdata);
+        setFieldAs(TBSCertListField.THIS_UPDATA, thisUpdata);
     }
 
     public Time getNextUpdate() {
-        return getFieldAs(NEXT_UPDATE, Time.class);
+        return getFieldAs(TBSCertListField.NEXT_UPDATE, Time.class);
     }
 
     public void setNextUpdate(Time nextUpdate) {
-        setFieldAs(NEXT_UPDATE, nextUpdate);
+        setFieldAs(TBSCertListField.NEXT_UPDATE, nextUpdate);
     }
 
     public RevokedCertificates getRevokedCertificates() {
-        return getFieldAs(REVOKED_CERTIFICATES, RevokedCertificates.class);
+        return getFieldAs(TBSCertListField.REVOKED_CERTIFICATES, RevokedCertificates.class);
     }
 
     public void setRevokedCertificates(RevokedCertificates revokedCertificates) {
-        setFieldAs(REVOKED_CERTIFICATES, revokedCertificates);
+        setFieldAs(TBSCertListField.REVOKED_CERTIFICATES, revokedCertificates);
     }
 
     public Extensions getCrlExtensions() {
-        return getFieldAs(CRL_EXTENSIONS, Extensions.class);
+        return getFieldAs(TBSCertListField.CRL_EXTENSIONS, Extensions.class);
     }
 
     public void setCrlExtensions(Extensions crlExtensions) {
-        setFieldAs(CRL_EXTENSIONS, crlExtensions);
+        setFieldAs(TBSCertListField.CRL_EXTENSIONS, crlExtensions);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertificate.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertificate.java
index 31f018d..cbe9662 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertificate.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TBSCertificate.java
@@ -28,8 +28,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x500.type.Name;
 
-import static org.apache.kerby.x509.type.TBSCertificate.MyEnum.*;
-
 /**
  * <pre>
  * TBSCertificate ::= SEQUENCE {
@@ -47,7 +45,7 @@ import static org.apache.kerby.x509.type.TBSCertificate.MyEnum.*;
  * </pre>
  */
 public class TBSCertificate extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum TBSCertificateField implements EnumType {
         VERSION,
         SERIAL_NUMBER,
         SIGNATURE,
@@ -71,16 +69,16 @@ public class TBSCertificate extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(VERSION, 0, Asn1Integer.class),
-            new Asn1FieldInfo(SERIAL_NUMBER, CertificateSerialNumber.class),
-            new Asn1FieldInfo(SIGNATURE, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(ISSUER, Name.class),
-            new Asn1FieldInfo(VALIDITY, AttCertValidityPeriod.class),
-            new Asn1FieldInfo(SUBJECT, Name.class),
-            new Asn1FieldInfo(SUBJECT_PUBLIC_KEY_INFO, SubjectPublicKeyInfo.class),
-            new ImplicitField(ISSUER_UNIQUE_ID, 1, Asn1BitString.class),
-            new ImplicitField(SUBJECT_UNIQUE_ID, 2, Asn1BitString.class),
-            new ExplicitField(EXTENSIONS, 3, Extensions.class)
+            new ExplicitField(TBSCertificateField.VERSION, Asn1Integer.class),
+            new Asn1FieldInfo(TBSCertificateField.SERIAL_NUMBER, CertificateSerialNumber.class),
+            new Asn1FieldInfo(TBSCertificateField.SIGNATURE, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(TBSCertificateField.ISSUER, Name.class),
+            new Asn1FieldInfo(TBSCertificateField.VALIDITY, AttCertValidityPeriod.class),
+            new Asn1FieldInfo(TBSCertificateField.SUBJECT, Name.class),
+            new Asn1FieldInfo(TBSCertificateField.SUBJECT_PUBLIC_KEY_INFO, SubjectPublicKeyInfo.class),
+            new ImplicitField(TBSCertificateField.ISSUER_UNIQUE_ID, 1, Asn1BitString.class),
+            new ImplicitField(TBSCertificateField.SUBJECT_UNIQUE_ID, 2, Asn1BitString.class),
+            new ExplicitField(TBSCertificateField.EXTENSIONS, 3, Extensions.class)
     };
 
     public TBSCertificate() {
@@ -88,82 +86,82 @@ public class TBSCertificate extends Asn1SequenceType {
     }
 
     public int getVersion() {
-        return getFieldAsInteger(VERSION);
+        return getFieldAsInteger(TBSCertificateField.VERSION);
     }
 
     public void setVersion(int version) {
-        setFieldAsInt(VERSION, version);
+        setFieldAsInt(TBSCertificateField.VERSION, version);
     }
 
     public CertificateSerialNumber getSerialNumber() {
-        return getFieldAs(SERIAL_NUMBER, CertificateSerialNumber.class);
+        return getFieldAs(TBSCertificateField.SERIAL_NUMBER, CertificateSerialNumber.class);
     }
 
     public void setSerialNumber(CertificateSerialNumber certificateSerialNumber) {
-        setFieldAs(SERIAL_NUMBER, certificateSerialNumber);
+        setFieldAs(TBSCertificateField.SERIAL_NUMBER, certificateSerialNumber);
     }
 
     public AlgorithmIdentifier getSignature() {
-        return getFieldAs(SIGNATURE, AlgorithmIdentifier.class);
+        return getFieldAs(TBSCertificateField.SIGNATURE, AlgorithmIdentifier.class);
     }
 
     public void setSignature(AlgorithmIdentifier signature) {
-        setFieldAs(SIGNATURE, signature);
+        setFieldAs(TBSCertificateField.SIGNATURE, signature);
     }
 
     public Name getIssuer() {
-        return getFieldAs(ISSUER, Name.class);
+        return getFieldAs(TBSCertificateField.ISSUER, Name.class);
     }
 
     public void setIssuer(Name attCertIssuer) {
-        setFieldAs(ISSUER, attCertIssuer);
+        setFieldAs(TBSCertificateField.ISSUER, attCertIssuer);
     }
 
     public AttCertValidityPeriod getValidity() {
-        return getFieldAs(VALIDITY, AttCertValidityPeriod.class);
+        return getFieldAs(TBSCertificateField.VALIDITY, AttCertValidityPeriod.class);
     }
 
     public void setValidity(AttCertValidityPeriod validity) {
-        setFieldAs(VALIDITY, validity);
+        setFieldAs(TBSCertificateField.VALIDITY, validity);
     }
 
     public Name getSubject() {
-        return getFieldAs(SUBJECT, Name.class);
+        return getFieldAs(TBSCertificateField.SUBJECT, Name.class);
     }
 
     public void setSubject(Name subject) {
-        setFieldAs(SUBJECT, subject);
+        setFieldAs(TBSCertificateField.SUBJECT, subject);
     }
 
     public SubjectPublicKeyInfo getSubjectPublicKeyInfo() {
-        return getFieldAs(SUBJECT_PUBLIC_KEY_INFO, SubjectPublicKeyInfo.class);
+        return getFieldAs(TBSCertificateField.SUBJECT_PUBLIC_KEY_INFO, SubjectPublicKeyInfo.class);
     }
 
     public void setSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo) {
-        setFieldAs(SUBJECT_PUBLIC_KEY_INFO, subjectPublicKeyInfo);
+        setFieldAs(TBSCertificateField.SUBJECT_PUBLIC_KEY_INFO, subjectPublicKeyInfo);
     }
 
     public byte[] getIssuerUniqueID() {
-        return getFieldAs(ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
+        return getFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
     }
 
     public void setIssuerUniqueId(byte[] issuerUniqueId) {
-        setFieldAs(ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
+        setFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
     }
 
     public byte[] getSubjectUniqueId() {
-        return getFieldAs(ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
+        return getFieldAs(TBSCertificateField.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
     }
 
     public void setSubjectUniqueId(byte[] issuerUniqueId) {
-        setFieldAs(SUBJECT_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
+        setFieldAs(TBSCertificateField.SUBJECT_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
     }
 
     public Extensions getExtensions() {
-        return getFieldAs(EXTENSIONS, Extensions.class);
+        return getFieldAs(TBSCertificateField.EXTENSIONS, Extensions.class);
     }
 
     public void setExtensions(Extensions extensions) {
-        setFieldAs(EXTENSIONS, extensions);
+        setFieldAs(TBSCertificateField.EXTENSIONS, extensions);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Target.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Target.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Target.java
index b332a40..cce4348 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Target.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Target.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 
-import static org.apache.kerby.x509.type.Target.MyEnum.*;
-
 /**
  * Ref. RFC 3281
  * <pre>
@@ -37,7 +35,7 @@ import static org.apache.kerby.x509.type.Target.MyEnum.*;
  * </pre>
  */
 public class Target extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum TargetField implements EnumType {
         TARGET_NAME,
         TARGET_GROUP,
         TARGET_CERT;
@@ -54,9 +52,9 @@ public class Target extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(TARGET_NAME, GeneralName.class),
-        new ExplicitField(TARGET_GROUP, GeneralName.class),
-        new ExplicitField(TARGET_CERT, TargetCert.class),
+        new ExplicitField(TargetField.TARGET_NAME, GeneralName.class),
+        new ExplicitField(TargetField.TARGET_GROUP, GeneralName.class),
+        new ExplicitField(TargetField.TARGET_CERT, TargetCert.class),
     };
 
     public Target() {
@@ -64,26 +62,26 @@ public class Target extends Asn1Choice {
     }
 
     public GeneralName getTargetName() {
-        return getChoiceValueAs(TARGET_NAME, GeneralName.class);
+        return getChoiceValueAs(TargetField.TARGET_NAME, GeneralName.class);
     }
 
     public void setTargetName(GeneralName targetName) {
-        setChoiceValue(TARGET_NAME, targetName);
+        setChoiceValue(TargetField.TARGET_NAME, targetName);
     }
 
     public GeneralName getTargetGroup() {
-        return getChoiceValueAs(TARGET_GROUP, GeneralName.class);
+        return getChoiceValueAs(TargetField.TARGET_GROUP, GeneralName.class);
     }
 
     public void setTargetGroup(GeneralName targetGroup) {
-        setChoiceValue(TARGET_GROUP, targetGroup);
+        setChoiceValue(TargetField.TARGET_GROUP, targetGroup);
     }
 
     public TargetCert targetCert() {
-        return getChoiceValueAs(TARGET_CERT, TargetCert.class);
+        return getChoiceValueAs(TargetField.TARGET_CERT, TargetCert.class);
     }
 
     public void setTargetCert(TargetCert targetCert) {
-        setChoiceValue(TARGET_CERT, targetCert);
+        setChoiceValue(TargetField.TARGET_CERT, targetCert);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TargetCert.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TargetCert.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TargetCert.java
index 7507208..d85b1d0 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TargetCert.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/TargetCert.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.TargetCert.MyEnum.*;
-
 /**
  * TargetCert  ::= SEQUENCE {
  *   targetCertificate    IssuerSerial,
@@ -33,7 +31,7 @@ import static org.apache.kerby.x509.type.TargetCert.MyEnum.*;
  * }
  */
 public class TargetCert extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum TargetCertField implements EnumType {
         TARGET_CERTIFICATE,
         TARGET_NAME,
         CERT_DIGEST_INFO;
@@ -50,9 +48,9 @@ public class TargetCert extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(TARGET_CERTIFICATE, IssuerSerial.class),
-            new Asn1FieldInfo(TARGET_NAME, GeneralName.class),
-            new Asn1FieldInfo(CERT_DIGEST_INFO, ObjectDigestInfo.class)
+            new Asn1FieldInfo(TargetCertField.TARGET_CERTIFICATE, IssuerSerial.class),
+            new Asn1FieldInfo(TargetCertField.TARGET_NAME, GeneralName.class),
+            new Asn1FieldInfo(TargetCertField.CERT_DIGEST_INFO, ObjectDigestInfo.class)
     };
 
     public TargetCert() {
@@ -60,26 +58,26 @@ public class TargetCert extends Asn1SequenceType {
     }
 
     public IssuerSerial getTargetCertificate() {
-        return getFieldAs(TARGET_CERTIFICATE, IssuerSerial.class);
+        return getFieldAs(TargetCertField.TARGET_CERTIFICATE, IssuerSerial.class);
     }
 
     public void setTargetCertificate(IssuerSerial targetCertificate) {
-        setFieldAs(TARGET_CERTIFICATE, targetCertificate);
+        setFieldAs(TargetCertField.TARGET_CERTIFICATE, targetCertificate);
     }
 
     public GeneralName getTargetName() {
-        return getFieldAs(TARGET_NAME, GeneralName.class);
+        return getFieldAs(TargetCertField.TARGET_NAME, GeneralName.class);
     }
 
     public void setTargetName(GeneralName targetName) {
-        setFieldAs(TARGET_NAME, targetName);
+        setFieldAs(TargetCertField.TARGET_NAME, targetName);
     }
 
     public ObjectDigestInfo getCertDigestInfo() {
-        return getFieldAs(CERT_DIGEST_INFO, ObjectDigestInfo.class);
+        return getFieldAs(TargetCertField.CERT_DIGEST_INFO, ObjectDigestInfo.class);
     }
 
     public void setCerttDigestInfo(ObjectDigestInfo certDigestInfo) {
-        setFieldAs(CERT_DIGEST_INFO, certDigestInfo);
+        setFieldAs(TargetCertField.CERT_DIGEST_INFO, certDigestInfo);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Time.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Time.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Time.java
index 5475b3d..a3a24d7 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Time.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Time.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1UtcTime;
 
 import java.util.Date;
 
-import static org.apache.kerby.x509.type.Time.MyEnum.*;
-
 /**
  *
  * <pre>
@@ -39,7 +37,7 @@ import static org.apache.kerby.x509.type.Time.MyEnum.*;
  * </pre>
  */
 public class Time extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum TimeField implements EnumType {
         UTC_TIME,
         GENERAL_TIME;
 
@@ -55,8 +53,8 @@ public class Time extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(UTC_TIME, Asn1UtcTime.class),
-        new Asn1FieldInfo(GENERAL_TIME, Asn1GeneralizedTime.class)
+        new Asn1FieldInfo(TimeField.UTC_TIME, Asn1UtcTime.class),
+        new Asn1FieldInfo(TimeField.GENERAL_TIME, Asn1GeneralizedTime.class)
     };
 
     public Time() {
@@ -64,18 +62,18 @@ public class Time extends Asn1Choice {
     }
 
     public Date getUtcTime() {
-        return getChoiceValueAs(UTC_TIME, Asn1UtcTime.class).getValue();
+        return getChoiceValueAs(TimeField.UTC_TIME, Asn1UtcTime.class).getValue();
     }
 
     public void setUtcTime(Asn1UtcTime utcTime) {
-        setChoiceValue(UTC_TIME, utcTime);
+        setChoiceValue(TimeField.UTC_TIME, utcTime);
     }
 
     public Date generalizedTime() {
-        return getChoiceValueAs(GENERAL_TIME, Asn1GeneralizedTime.class).getValue();
+        return getChoiceValueAs(TimeField.GENERAL_TIME, Asn1GeneralizedTime.class).getValue();
     }
 
     public void setGeneralTime(Asn1GeneralizedTime generalTime) {
-        setChoiceValue(GENERAL_TIME, generalTime);
+        setChoiceValue(TimeField.GENERAL_TIME, generalTime);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/UserNotice.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/UserNotice.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/UserNotice.java
index 776e88e..cf19323 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/UserNotice.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/UserNotice.java
@@ -23,8 +23,6 @@ import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.UserNotice.MyEnum.*;
-
 /**
  *
  * <pre>
@@ -36,7 +34,7 @@ import static org.apache.kerby.x509.type.UserNotice.MyEnum.*;
  *
  */
 public class UserNotice extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum UserNoticeField implements EnumType {
         NOTICE_REF,
         EXPLICIT_TEXT;
 
@@ -52,8 +50,8 @@ public class UserNotice extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(NOTICE_REF, NoticeReference.class),
-        new Asn1FieldInfo(EXPLICIT_TEXT, DisplayText.class)
+        new Asn1FieldInfo(UserNoticeField.NOTICE_REF, NoticeReference.class),
+        new Asn1FieldInfo(UserNoticeField.EXPLICIT_TEXT, DisplayText.class)
     };
 
     public UserNotice() {
@@ -61,18 +59,18 @@ public class UserNotice extends Asn1SequenceType {
     }
 
     public NoticeReference getNoticeRef() {
-        return getFieldAs(NOTICE_REF, NoticeReference.class);
+        return getFieldAs(UserNoticeField.NOTICE_REF, NoticeReference.class);
     }
 
     public void setNoticeRef(NoticeReference noticeRef) {
-        setFieldAs(NOTICE_REF, noticeRef);
+        setFieldAs(UserNoticeField.NOTICE_REF, noticeRef);
     }
     
     public DisplayText getExplicitText() {
-        return getFieldAs(EXPLICIT_TEXT, DisplayText.class);
+        return getFieldAs(UserNoticeField.EXPLICIT_TEXT, DisplayText.class);
     }
 
     public void setExplicitText(DisplayText explicitText) {
-        setFieldAs(EXPLICIT_TEXT, explicitText);
+        setFieldAs(UserNoticeField.EXPLICIT_TEXT, explicitText);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/c00bbc71/kerby-pkix/src/main/java/org/apache/kerby/x509/type/V2Form.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/V2Form.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/V2Form.java
index 4b7cc3a..3b49758 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/V2Form.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/V2Form.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.x509.type.V2Form.MyEnum.*;
-
 /**
  * Produce an object suitable for an ASN1OutputStream.
  * <pre>
@@ -40,7 +38,7 @@ import static org.apache.kerby.x509.type.V2Form.MyEnum.*;
  * </pre>
  */
 public class V2Form extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum V2FormField implements EnumType {
         ISSUER_NAME,
         BASE_CERTIFICATE_ID,
         OBJECT_DIGEST_INFO;
@@ -57,9 +55,9 @@ public class V2Form extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new Asn1FieldInfo(ISSUER_NAME, GeneralNames.class),
-        new ExplicitField(BASE_CERTIFICATE_ID, 0, IssuerSerial.class),
-        new ExplicitField(OBJECT_DIGEST_INFO, 1, ObjectDigestInfo.class)
+        new Asn1FieldInfo(V2FormField.ISSUER_NAME, GeneralNames.class),
+        new ExplicitField(V2FormField.BASE_CERTIFICATE_ID, 0, IssuerSerial.class),
+        new ExplicitField(V2FormField.OBJECT_DIGEST_INFO, 1, ObjectDigestInfo.class)
     };
 
     public V2Form() {
@@ -67,26 +65,26 @@ public class V2Form extends Asn1SequenceType {
     }
 
     public GeneralNames getIssuerName() {
-        return getFieldAs(ISSUER_NAME, GeneralNames.class);
+        return getFieldAs(V2FormField.ISSUER_NAME, GeneralNames.class);
     }
 
     public void setIssuerName(GeneralNames issuerName) {
-        setFieldAs(ISSUER_NAME, issuerName);
+        setFieldAs(V2FormField.ISSUER_NAME, issuerName);
     }
 
     public IssuerSerial getBaseCertificateID() {
-        return getFieldAs(BASE_CERTIFICATE_ID, IssuerSerial.class);
+        return getFieldAs(V2FormField.BASE_CERTIFICATE_ID, IssuerSerial.class);
     }
 
     public void setBaseCertificateId(IssuerSerial baseCertificateId) {
-        setFieldAs(BASE_CERTIFICATE_ID, baseCertificateId);
+        setFieldAs(V2FormField.BASE_CERTIFICATE_ID, baseCertificateId);
     }
 
     public ObjectDigestInfo getObjectDigestInfo() {
-        return getFieldAs(OBJECT_DIGEST_INFO, ObjectDigestInfo.class);
+        return getFieldAs(V2FormField.OBJECT_DIGEST_INFO, ObjectDigestInfo.class);
     }
 
     public void setObjectDigestInfo(ObjectDigestInfo objectDigestInfo) {
-        setFieldAs(OBJECT_DIGEST_INFO, objectDigestInfo);
+        setFieldAs(V2FormField.OBJECT_DIGEST_INFO, objectDigestInfo);
     }
 }


Mime
View raw message