directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [2/2] directory-kerby git commit: DIRKRB-515 Rename enum type in kerby-pkix/cms.type. Contributed by Yan.
Date Wed, 30 Dec 2015 05:43:04 GMT
DIRKRB-515 Rename enum type in kerby-pkix/cms.type. Contributed by Yan.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/2fd8e119
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/2fd8e119
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/2fd8e119

Branch: refs/heads/trunk
Commit: 2fd8e1191da135e2b3a9107edf7b08ce4e7d8edd
Parents: c00bbc7
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Wed Dec 30 13:49:48 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Wed Dec 30 13:49:48 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/cms/type/Attribute.java    | 16 +++---
 .../cms/type/AttributeCertificateInfoV1.java    | 58 ++++++++++----------
 .../kerby/cms/type/AttributeCertificateV1.java  | 22 ++++----
 .../kerby/cms/type/CertificateChoices.java      | 34 ++++++------
 .../kerby/cms/type/CompressedContentInfo.java   |  8 +--
 .../apache/kerby/cms/type/CompressedData.java   | 22 ++++----
 .../org/apache/kerby/cms/type/ContentInfo.java  | 16 +++---
 .../kerby/cms/type/EncapsulatedContentInfo.java | 16 +++---
 .../kerby/cms/type/EncryptedContentInfo.java    | 22 ++++----
 .../kerby/cms/type/EnvelopedContentInfo.java    |  8 +--
 .../apache/kerby/cms/type/EnvelopedData.java    | 34 ++++++------
 .../kerby/cms/type/ExtendedCertificate.java     | 22 ++++----
 .../kerby/cms/type/ExtendedCertificateInfo.java | 22 ++++----
 .../kerby/cms/type/IssuerAndSerialNumber.java   | 16 +++---
 .../apache/kerby/cms/type/KEKIdentifier.java    | 22 ++++----
 .../apache/kerby/cms/type/KEKRecipientInfo.java | 28 +++++-----
 .../cms/type/KeyAgreeRecipientIdentifier.java   | 16 +++---
 .../kerby/cms/type/KeyAgreeRecipientInfo.java   | 34 ++++++------
 .../kerby/cms/type/KeyTransRecipientInfo.java   | 28 +++++-----
 .../cms/type/OriginatorIdentifierOrKey.java     | 22 ++++----
 .../apache/kerby/cms/type/OriginatorInfo.java   | 16 +++---
 .../kerby/cms/type/OriginatorPublicKey.java     | 16 +++---
 .../kerby/cms/type/OtherCertificateFormat.java  | 16 +++---
 .../kerby/cms/type/OtherKeyAttribute.java       | 16 +++---
 .../kerby/cms/type/OtherRecipientInfo.java      | 16 +++---
 .../cms/type/OtherRevocationInfoFormat.java     | 16 +++---
 .../kerby/cms/type/PasswordRecipientInfo.java   | 28 +++++-----
 .../kerby/cms/type/RecipientEncryptedKey.java   | 16 +++---
 .../kerby/cms/type/RecipientIdentifier.java     | 16 +++---
 .../apache/kerby/cms/type/RecipientInfo.java    | 34 ++++++------
 .../kerby/cms/type/RecipientKeyIdentifier.java  | 22 ++++----
 .../kerby/cms/type/RevocationInfoChoice.java    | 16 +++---
 .../kerby/cms/type/SignedContentInfo.java       |  8 +--
 .../org/apache/kerby/cms/type/SignedData.java   | 40 +++++++-------
 .../apache/kerby/cms/type/SignerIdentifier.java | 16 +++---
 .../org/apache/kerby/cms/type/SignerInfo.java   | 46 ++++++++--------
 .../java/org/apache/kerby/cms/type/Subject.java | 16 +++---
 37 files changed, 373 insertions(+), 447 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/Attribute.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/Attribute.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/Attribute.java
index 1bfb21d..2656f5f 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/Attribute.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/Attribute.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x509.type.AttributeValues;
 
-import static org.apache.kerby.cms.type.Attribute.MyEnum.*;
-
 /**
  * Ref. RFC 5652
  * <pre>
@@ -39,7 +37,7 @@ import static org.apache.kerby.cms.type.Attribute.MyEnum.*;
  * </pre>
  */
 public class Attribute extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AttributeField implements EnumType {
         ATTR_TYPE,
         ATTR_VALUES;
 
@@ -55,8 +53,8 @@ public class Attribute extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-        new Asn1FieldInfo(ATTR_TYPE, Asn1ObjectIdentifier.class),
-        new Asn1FieldInfo(ATTR_VALUES, AttributeValues.class),
+        new Asn1FieldInfo(AttributeField.ATTR_TYPE, Asn1ObjectIdentifier.class),
+        new Asn1FieldInfo(AttributeField.ATTR_VALUES, AttributeValues.class),
     };
 
     public Attribute() {
@@ -64,18 +62,18 @@ public class Attribute extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getAttrType() {
-        return getFieldAs(ATTR_TYPE, Asn1ObjectIdentifier.class);
+        return getFieldAs(AttributeField.ATTR_TYPE, Asn1ObjectIdentifier.class);
     }
 
     public void setAttrType(Asn1ObjectIdentifier attrType) {
-        setFieldAs(ATTR_TYPE, attrType);
+        setFieldAs(AttributeField.ATTR_TYPE, attrType);
     }
 
     public AttributeValues getAttrValues() {
-        return getFieldAs(ATTR_VALUES, AttributeValues.class);
+        return getFieldAs(AttributeField.ATTR_VALUES, AttributeValues.class);
     }
 
     public void setAttrValues(AttributeValues values) {
-        setFieldAs(ATTR_VALUES, values);
+        setFieldAs(AttributeField.ATTR_VALUES, values);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateInfoV1.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateInfoV1.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateInfoV1.java
index b0a894b..0b90e77 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateInfoV1.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateInfoV1.java
@@ -31,8 +31,6 @@ import org.apache.kerby.x509.type.Attributes;
 import org.apache.kerby.x509.type.CertificateSerialNumber;
 import org.apache.kerby.x509.type.Extensions;
 
-import static org.apache.kerby.cms.type.AttributeCertificateInfoV1.MyEnum.*;
-
 /**
  * AttributeCertificateInfoV1 ::= SEQUENCE {
  *   version AttCertVersionV1 DEFAULT v1,
@@ -49,7 +47,7 @@ import static org.apache.kerby.cms.type.AttributeCertificateInfoV1.MyEnum.*;
  * AttCertVersionV1 ::= INTEGER { v1(0) }
  */
 public class AttributeCertificateInfoV1 extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AttributeCertificateInfoV1Field implements EnumType {
         VERSION,
         SUBJECT,
         ISSUER,
@@ -72,15 +70,15 @@ public class AttributeCertificateInfoV1 extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(VERSION, Asn1Integer.class),
-            new Asn1FieldInfo(SUBJECT, Subject.class),
-            new Asn1FieldInfo(ISSUER, AttCertIssuer.class),
-            new Asn1FieldInfo(SIGNATURE, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(SERIAL_NUMBER, CertificateSerialNumber.class),
-            new Asn1FieldInfo(ATTR_CERT_VALIDITY_PERIOD, AttCertValidityPeriod.class),
-            new Asn1FieldInfo(ATTRIBUTES, Attributes.class),
-            new Asn1FieldInfo(ISSUER_UNIQUE_ID, Asn1BitString.class),
-            new Asn1FieldInfo(EXTENSIONS, Extensions.class)
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.VERSION, Asn1Integer.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.SUBJECT, Subject.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.ISSUER, AttCertIssuer.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.SIGNATURE, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.SERIAL_NUMBER, CertificateSerialNumber.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.ATTR_CERT_VALIDITY_PERIOD, AttCertValidityPeriod.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.ATTRIBUTES, Attributes.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, Asn1BitString.class),
+            new Asn1FieldInfo(AttributeCertificateInfoV1Field.EXTENSIONS, Extensions.class)
     };
 
     public AttributeCertificateInfoV1() {
@@ -88,74 +86,74 @@ public class AttributeCertificateInfoV1 extends Asn1SequenceType {
     }
 
     public int getVersion() {
-        return getFieldAsInteger(VERSION);
+        return getFieldAsInteger(AttributeCertificateInfoV1Field.VERSION);
     }
 
     public void setVersion(int version) {
-        setFieldAsInt(VERSION, version);
+        setFieldAsInt(AttributeCertificateInfoV1Field.VERSION, version);
     }
 
     public Subject getSubject() {
-        return getFieldAs(SUBJECT, Subject.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.SUBJECT, Subject.class);
     }
 
     public void setSubject(Subject subject) {
-        setFieldAs(SUBJECT, subject);
+        setFieldAs(AttributeCertificateInfoV1Field.SUBJECT, subject);
     }
 
     public AttCertIssuer getIssuer() {
-        return getFieldAs(ISSUER, AttCertIssuer.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.ISSUER, AttCertIssuer.class);
     }
 
     public void setIssuer(AttCertIssuer attCertIssuer) {
-        setFieldAs(ISSUER, attCertIssuer);
+        setFieldAs(AttributeCertificateInfoV1Field.ISSUER, attCertIssuer);
     }
 
     public AlgorithmIdentifier getSignature() {
-        return getFieldAs(SIGNATURE, AlgorithmIdentifier.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.SIGNATURE, AlgorithmIdentifier.class);
     }
 
     public void setSignature(AlgorithmIdentifier signature) {
-        setFieldAs(SIGNATURE, signature);
+        setFieldAs(AttributeCertificateInfoV1Field.SIGNATURE, signature);
     }
 
     public CertificateSerialNumber getSerialNumber() {
-        return getFieldAs(SERIAL_NUMBER, CertificateSerialNumber.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.SERIAL_NUMBER, CertificateSerialNumber.class);
     }
 
     public void setSerialNumber(CertificateSerialNumber certificateSerialNumber) {
-        setFieldAs(SERIAL_NUMBER, certificateSerialNumber);
+        setFieldAs(AttributeCertificateInfoV1Field.SERIAL_NUMBER, certificateSerialNumber);
     }
 
     public AttCertValidityPeriod getAttrCertValidityPeriod() {
-        return getFieldAs(ATTR_CERT_VALIDITY_PERIOD, AttCertValidityPeriod.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.ATTR_CERT_VALIDITY_PERIOD, AttCertValidityPeriod.class);
     }
 
     public void setAttrCertValidityPeriod(AttCertValidityPeriod attrCertValidityPeriod) {
-        setFieldAs(ATTR_CERT_VALIDITY_PERIOD, attrCertValidityPeriod);
+        setFieldAs(AttributeCertificateInfoV1Field.ATTR_CERT_VALIDITY_PERIOD, attrCertValidityPeriod);
     }
 
     public Attributes getAttributes() {
-        return getFieldAs(ATTRIBUTES, Attributes.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.ATTRIBUTES, Attributes.class);
     }
 
     public void setAttributes(Attributes attributes) {
-        setFieldAs(ATTRIBUTES, attributes);
+        setFieldAs(AttributeCertificateInfoV1Field.ATTRIBUTES, attributes);
     }
 
     public byte[] getIssuerUniqueID() {
-        return getFieldAs(ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
+        return getFieldAs(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
     }
 
     public void setIssuerUniqueId(byte[] issuerUniqueId) {
-        setFieldAs(ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
+        setFieldAs(AttributeCertificateInfoV1Field.ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
     }
 
     public Extensions getExtensions() {
-        return getFieldAs(EXTENSIONS, Extensions.class);
+        return getFieldAs(AttributeCertificateInfoV1Field.EXTENSIONS, Extensions.class);
     }
 
     public void setExtensions(Extensions extensions) {
-        setFieldAs(EXTENSIONS, extensions);
+        setFieldAs(AttributeCertificateInfoV1Field.EXTENSIONS, extensions);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateV1.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateV1.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateV1.java
index b84a09d..9a94821 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateV1.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/AttributeCertificateV1.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x509.type.AlgorithmIdentifier;
 import org.apache.kerby.x509.type.AttributeCertificateInfo;
 
-import static org.apache.kerby.cms.type.AttributeCertificateV1.MyEnum.*;
-
 /**
  * AttributeCertificateV1 ::= SEQUENCE {
  *   acInfo AttributeCertificateInfoV1,
@@ -36,7 +34,7 @@ import static org.apache.kerby.cms.type.AttributeCertificateV1.MyEnum.*;
  * }
  */
 public class AttributeCertificateV1 extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AttributeCertificateV1Field implements EnumType {
         ACI_INFO,
         SIGNATURE_ALGORITHM,
         SIGNATURE;
@@ -53,9 +51,9 @@ public class AttributeCertificateV1 extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(ACI_INFO, AttributeCertificateInfoV1.class),
-            new Asn1FieldInfo(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(SIGNATURE, Asn1BitString.class)
+            new Asn1FieldInfo(AttributeCertificateV1Field.ACI_INFO, AttributeCertificateInfoV1.class),
+            new Asn1FieldInfo(AttributeCertificateV1Field.SIGNATURE_ALGORITHM, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(AttributeCertificateV1Field.SIGNATURE, Asn1BitString.class)
     };
 
     public AttributeCertificateV1() {
@@ -63,26 +61,26 @@ public class AttributeCertificateV1 extends Asn1SequenceType {
     }
 
     public AttributeCertificateInfo getAcinfo() {
-        return getFieldAs(ACI_INFO, AttributeCertificateInfo.class);
+        return getFieldAs(AttributeCertificateV1Field.ACI_INFO, AttributeCertificateInfo.class);
     }
 
     public void setAciInfo(AttributeCertificateInfo aciInfo) {
-        setFieldAs(ACI_INFO, aciInfo);
+        setFieldAs(AttributeCertificateV1Field.ACI_INFO, aciInfo);
     }
 
     public AlgorithmIdentifier getSignatureAlgorithm() {
-        return getFieldAs(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class);
+        return getFieldAs(AttributeCertificateV1Field.SIGNATURE_ALGORITHM, AlgorithmIdentifier.class);
     }
 
     public void setSignatureAlgorithm(AlgorithmIdentifier signatureAlgorithm) {
-        setFieldAs(SIGNATURE_ALGORITHM, signatureAlgorithm);
+        setFieldAs(AttributeCertificateV1Field.SIGNATURE_ALGORITHM, signatureAlgorithm);
     }
 
     public Asn1BitString getSignatureValue() {
-        return getFieldAs(SIGNATURE, Asn1BitString.class);
+        return getFieldAs(AttributeCertificateV1Field.SIGNATURE, Asn1BitString.class);
     }
 
     public void setSignatureValue(Asn1BitString signatureValue) {
-        setFieldAs(SIGNATURE, signatureValue);
+        setFieldAs(AttributeCertificateV1Field.SIGNATURE, signatureValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CertificateChoices.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CertificateChoices.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CertificateChoices.java
index 57a0a48..edab81d 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CertificateChoices.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CertificateChoices.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 import org.apache.kerby.x509.type.Certificate;
 
-import static org.apache.kerby.cms.type.CertificateChoices.MyEnum.*;
-
 /**
  * CertificateChoices ::= CHOICE {
  *   certificate Certificate,
@@ -36,7 +34,7 @@ import static org.apache.kerby.cms.type.CertificateChoices.MyEnum.*;
  *   other [3] IMPLICIT OtherCertificateFormat }
  */
 public class CertificateChoices extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum CertificateChoicesField implements EnumType {
         CERTIFICATE,
         EXTENDED_CERTIFICATE,
         V1_ATTR_CERT,
@@ -55,11 +53,11 @@ public class CertificateChoices extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(CERTIFICATE, Certificate.class),
-            new ImplicitField(EXTENDED_CERTIFICATE, 0, ExtendedCertificate.class),
-            new ImplicitField(V1_ATTR_CERT, 1, AttributeCertificateV1.class),
-            new ImplicitField(V2_ATTR_CERT, 2, AttributeCertificateV2.class),
-            new ImplicitField(OTHER, 3, OtherCertificateFormat.class),
+            new Asn1FieldInfo(CertificateChoicesField.CERTIFICATE, Certificate.class),
+            new ImplicitField(CertificateChoicesField.EXTENDED_CERTIFICATE, 0, ExtendedCertificate.class),
+            new ImplicitField(CertificateChoicesField.V1_ATTR_CERT, 1, AttributeCertificateV1.class),
+            new ImplicitField(CertificateChoicesField.V2_ATTR_CERT, 2, AttributeCertificateV2.class),
+            new ImplicitField(CertificateChoicesField.OTHER, 3, OtherCertificateFormat.class),
     };
 
     public CertificateChoices() {
@@ -67,42 +65,42 @@ public class CertificateChoices extends Asn1Choice {
     }
 
     public Certificate getCertificate() {
-        return getChoiceValueAs(CERTIFICATE, Certificate.class);
+        return getChoiceValueAs(CertificateChoicesField.CERTIFICATE, Certificate.class);
     }
 
     public void setCertificate(Certificate certificate) {
-        setChoiceValue(CERTIFICATE, certificate);
+        setChoiceValue(CertificateChoicesField.CERTIFICATE, certificate);
     }
 
     public ExtendedCertificate getExtendedCertificate() {
-        return getChoiceValueAs(EXTENDED_CERTIFICATE, ExtendedCertificate.class);
+        return getChoiceValueAs(CertificateChoicesField.EXTENDED_CERTIFICATE, ExtendedCertificate.class);
     }
 
     public void setExtendedCertificate(ExtendedCertificate extendedCertificate) {
-        setChoiceValue(EXTENDED_CERTIFICATE, extendedCertificate);
+        setChoiceValue(CertificateChoicesField.EXTENDED_CERTIFICATE, extendedCertificate);
     }
 
     public AttributeCertificateV1 getV1AttrCert() {
-        return getChoiceValueAs(V1_ATTR_CERT, AttributeCertificateV1.class);
+        return getChoiceValueAs(CertificateChoicesField.V1_ATTR_CERT, AttributeCertificateV1.class);
     }
 
     public void setV1AttrCert(AttributeCertificateV1 v1AttrCert) {
-        setChoiceValue(V1_ATTR_CERT, v1AttrCert);
+        setChoiceValue(CertificateChoicesField.V1_ATTR_CERT, v1AttrCert);
     }
 
     public AttributeCertificateV2 getV2AttrCert() {
-        return getChoiceValueAs(V2_ATTR_CERT, AttributeCertificateV2.class);
+        return getChoiceValueAs(CertificateChoicesField.V2_ATTR_CERT, AttributeCertificateV2.class);
     }
 
     public void setV2AttrCert(AttributeCertificateV2 v2AttrCert) {
-        setChoiceValue(V2_ATTR_CERT, v2AttrCert);
+        setChoiceValue(CertificateChoicesField.V2_ATTR_CERT, v2AttrCert);
     }
 
     public OtherCertificateFormat getOther() {
-        return getChoiceValueAs(OTHER, OtherCertificateFormat.class);
+        return getChoiceValueAs(CertificateChoicesField.OTHER, OtherCertificateFormat.class);
     }
 
     public void setOther(OtherCertificateFormat other) {
-        setChoiceValue(OTHER, other);
+        setChoiceValue(CertificateChoicesField.OTHER, other);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedContentInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedContentInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedContentInfo.java
index ab26f64..b563136 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedContentInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedContentInfo.java
@@ -19,8 +19,6 @@
  */
 package org.apache.kerby.cms.type;
 
-import static org.apache.kerby.cms.type.ContentInfo.MyEnum.*;
-
 /**
  * A ContentInfo that wraps CompressedData.
  */
@@ -28,14 +26,14 @@ public class CompressedContentInfo extends ContentInfo {
 
     public CompressedContentInfo() {
         super();
-        setAnyFieldValueType(CONTENT, CompressedData.class);
+        setAnyFieldValueType(ContentInfoField.CONTENT, CompressedData.class);
     }
 
     public CompressedData getCompressedData() {
-        return getFieldAsAny(CONTENT, CompressedData.class);
+        return getFieldAsAny(ContentInfoField.CONTENT, CompressedData.class);
     }
 
     public void setCompressedData(CompressedData signedData) {
-        setFieldAsAny(CONTENT, signedData);
+        setFieldAsAny(ContentInfoField.CONTENT, signedData);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedData.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedData.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedData.java
index 2995421..9d66c1e 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedData.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/CompressedData.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x509.type.AlgorithmIdentifier;
 
-import static org.apache.kerby.cms.type.CompressedData.MyEnum.*;
-
 /** 
  * Ref. RFC 3274
  * 
@@ -38,7 +36,7 @@ import static org.apache.kerby.cms.type.CompressedData.MyEnum.*;
  * </pre>
  */
 public class CompressedData extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum CompressedDataField implements EnumType {
         VERSION,
         COMPRESSION_ALGORITHM,
         ENCAP_CONTENT_INFO;
@@ -55,9 +53,9 @@ public class CompressedData extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(VERSION, CmsVersion.class),
-            new Asn1FieldInfo(COMPRESSION_ALGORITHM, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(ENCAP_CONTENT_INFO, EncapsulatedContentInfo.class)
+            new Asn1FieldInfo(CompressedDataField.VERSION, CmsVersion.class),
+            new Asn1FieldInfo(CompressedDataField.COMPRESSION_ALGORITHM, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(CompressedDataField.ENCAP_CONTENT_INFO, EncapsulatedContentInfo.class)
     };
 
     public CompressedData() {
@@ -65,27 +63,27 @@ public class CompressedData extends Asn1SequenceType {
     }
 
     public CmsVersion getVersion() {
-        return getFieldAs(VERSION, CmsVersion.class);
+        return getFieldAs(CompressedDataField.VERSION, CmsVersion.class);
     }
 
     public void setVersion(CmsVersion version) {
-        setFieldAs(VERSION, version);
+        setFieldAs(CompressedDataField.VERSION, version);
     }
 
     public AlgorithmIdentifier getCompressionAlgorithm() {
-        return getFieldAs(COMPRESSION_ALGORITHM, AlgorithmIdentifier.class);
+        return getFieldAs(CompressedDataField.COMPRESSION_ALGORITHM, AlgorithmIdentifier.class);
     }
 
     public void setCompressionAlgorithm(AlgorithmIdentifier compressionAlgorithm) {
-        setFieldAs(COMPRESSION_ALGORITHM, compressionAlgorithm);
+        setFieldAs(CompressedDataField.COMPRESSION_ALGORITHM, compressionAlgorithm);
     }
 
     public EncapsulatedContentInfo getEncapContentInfo() {
-        return getFieldAs(ENCAP_CONTENT_INFO, EncapsulatedContentInfo.class);
+        return getFieldAs(CompressedDataField.ENCAP_CONTENT_INFO, EncapsulatedContentInfo.class);
     }
 
     public void setEncapContentInfo(EncapsulatedContentInfo encapContentInfo) {
-        setFieldAs(ENCAP_CONTENT_INFO, encapContentInfo);
+        setFieldAs(CompressedDataField.ENCAP_CONTENT_INFO, encapContentInfo);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ContentInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ContentInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ContentInfo.java
index 5037efa..371861d 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ContentInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ContentInfo.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.cms.type.ContentInfo.MyEnum.*;
-
 /**
  * Ref. RFC 5652
  *
@@ -42,7 +40,7 @@ import static org.apache.kerby.cms.type.ContentInfo.MyEnum.*;
  * </pre>
  */
 public class ContentInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ContentInfoField implements EnumType {
         CONTENT_TYPE,
         CONTENT;
 
@@ -58,8 +56,8 @@ public class ContentInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-        new Asn1FieldInfo(CONTENT_TYPE, Asn1ObjectIdentifier.class),
-        new ExplicitField(CONTENT, 0, Asn1Any.class),
+        new Asn1FieldInfo(ContentInfoField.CONTENT_TYPE, Asn1ObjectIdentifier.class),
+        new ExplicitField(ContentInfoField.CONTENT, 0, Asn1Any.class),
     };
 
     public ContentInfo() {
@@ -67,18 +65,18 @@ public class ContentInfo extends Asn1SequenceType {
     }
 
     public String getContentType() {
-        return getFieldAsObjId(CONTENT_TYPE);
+        return getFieldAsObjId(ContentInfoField.CONTENT_TYPE);
     }
 
     public void setContentType(String contentType) {
-        setFieldAsObjId(CONTENT_TYPE, contentType);
+        setFieldAsObjId(ContentInfoField.CONTENT_TYPE, contentType);
     }
 
     public <T extends Asn1Type> T getContentAs(Class<T> t) {
-        return getFieldAsAny(CONTENT, t);
+        return getFieldAsAny(ContentInfoField.CONTENT, t);
     }
 
     public void setContent(Asn1Type content) {
-        setFieldAsAny(CONTENT, content);
+        setFieldAsAny(ContentInfoField.CONTENT, content);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncapsulatedContentInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncapsulatedContentInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncapsulatedContentInfo.java
index a7a260a..6d1a74f 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncapsulatedContentInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncapsulatedContentInfo.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.EncapsulatedContentInfo.MyEnum.*;
-
 /**
  * EncapsulatedContentInfo ::= SEQUENCE {
  *   eContentType ContentType,
@@ -37,7 +35,7 @@ import static org.apache.kerby.cms.type.EncapsulatedContentInfo.MyEnum.*;
  * ContentType ::= OBJECT IDENTIFIER
  */
 public class EncapsulatedContentInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EncapsulatedContentInfoField implements EnumType {
         CONTENT_TYPE,
         CONTENT;
 
@@ -53,8 +51,8 @@ public class EncapsulatedContentInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new Asn1FieldInfo(CONTENT_TYPE, Asn1ObjectIdentifier.class),
-            new ExplicitField(CONTENT, 0, Asn1OctetString.class)
+            new Asn1FieldInfo(EncapsulatedContentInfoField.CONTENT_TYPE, Asn1ObjectIdentifier.class),
+            new ExplicitField(EncapsulatedContentInfoField.CONTENT, 0, Asn1OctetString.class)
     };
 
     public EncapsulatedContentInfo() {
@@ -62,18 +60,18 @@ public class EncapsulatedContentInfo extends Asn1SequenceType {
     }
 
     public String getContentType() {
-        return getFieldAsObjId(CONTENT_TYPE);
+        return getFieldAsObjId(EncapsulatedContentInfoField.CONTENT_TYPE);
     }
 
     public void setContentType(String contentType) {
-        setFieldAsObjId(CONTENT_TYPE, contentType);
+        setFieldAsObjId(EncapsulatedContentInfoField.CONTENT_TYPE, contentType);
     }
 
     public byte[] getContent() {
-        return getFieldAsOctets(CONTENT);
+        return getFieldAsOctets(EncapsulatedContentInfoField.CONTENT);
     }
 
     public void setContent(byte[] content) {
-        setFieldAsOctets(CONTENT, content);
+        setFieldAsOctets(EncapsulatedContentInfoField.CONTENT, content);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncryptedContentInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncryptedContentInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncryptedContentInfo.java
index c6d5872..7fc953a 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncryptedContentInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EncryptedContentInfo.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.EncryptedContentInfo.MyEnum.*;
-
 /**
  * EncryptedContentInfo ::= SEQUENCE {
  *   contentType ContentType,
@@ -39,7 +37,7 @@ import static org.apache.kerby.cms.type.EncryptedContentInfo.MyEnum.*;
  * EncryptedContent ::= OCTET STRING
  */
 public class EncryptedContentInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ECInfoField implements EnumType {
         CONTENT_TYPE,
         CONTENT_ENCRYPTION_ALGORITHM,
         ENCRYPTED_CONTENT;
@@ -56,9 +54,9 @@ public class EncryptedContentInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(CONTENT_TYPE, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(CONTENT_ENCRYPTION_ALGORITHM, ContentEncryptionAlgorithmIdentifier.class),
-            new ImplicitField(ENCRYPTED_CONTENT, 0, Asn1OctetString.class)
+            new Asn1FieldInfo(ECInfoField.CONTENT_TYPE, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(ECInfoField.CONTENT_ENCRYPTION_ALGORITHM, ContentEncryptionAlgorithmIdentifier.class),
+            new ImplicitField(ECInfoField.ENCRYPTED_CONTENT, 0, Asn1OctetString.class)
     };
 
     public EncryptedContentInfo() {
@@ -66,27 +64,27 @@ public class EncryptedContentInfo extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getContentType() {
-        return getFieldAs(CONTENT_TYPE, Asn1ObjectIdentifier.class);
+        return getFieldAs(ECInfoField.CONTENT_TYPE, Asn1ObjectIdentifier.class);
     }
 
     public void setContentType(Asn1ObjectIdentifier contentType) {
-        setFieldAs(CONTENT_TYPE, contentType);
+        setFieldAs(ECInfoField.CONTENT_TYPE, contentType);
     }
 
     public ContentEncryptionAlgorithmIdentifier getContentEncryptionAlgorithmIdentifier() {
-        return getFieldAs(CONTENT_ENCRYPTION_ALGORITHM, ContentEncryptionAlgorithmIdentifier.class);
+        return getFieldAs(ECInfoField.CONTENT_ENCRYPTION_ALGORITHM, ContentEncryptionAlgorithmIdentifier.class);
     }
 
     public void setContentEncryptionAlgorithmIdentifier(ContentEncryptionAlgorithmIdentifier
                                                                 contentEncryptionAlgorithmIdentifier) {
-        setFieldAs(CONTENT_ENCRYPTION_ALGORITHM, contentEncryptionAlgorithmIdentifier);
+        setFieldAs(ECInfoField.CONTENT_ENCRYPTION_ALGORITHM, contentEncryptionAlgorithmIdentifier);
     }
 
     public Asn1OctetString getEncryptedContent() {
-        return getFieldAs(ENCRYPTED_CONTENT, Asn1OctetString.class);
+        return getFieldAs(ECInfoField.ENCRYPTED_CONTENT, Asn1OctetString.class);
     }
 
     public void setEncryptedContent(Asn1OctetString encryptedContent) {
-        setFieldAs(ENCRYPTED_CONTENT, encryptedContent);
+        setFieldAs(ECInfoField.ENCRYPTED_CONTENT, encryptedContent);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedContentInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedContentInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedContentInfo.java
index 7674b87..49800e3 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedContentInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedContentInfo.java
@@ -19,8 +19,6 @@
  */
 package org.apache.kerby.cms.type;
 
-import static org.apache.kerby.cms.type.ContentInfo.MyEnum.*;
-
 /**
  * A ContentInfo that wraps EnvelopedData.
  */
@@ -28,14 +26,14 @@ public class EnvelopedContentInfo extends ContentInfo {
 
     public EnvelopedContentInfo() {
         super();
-        setAnyFieldValueType(CONTENT, EnvelopedData.class);
+        setAnyFieldValueType(ContentInfoField.CONTENT, EnvelopedData.class);
     }
 
     public EnvelopedData getEnvelopedData() {
-        return getFieldAsAny(CONTENT, EnvelopedData.class);
+        return getFieldAsAny(ContentInfoField.CONTENT, EnvelopedData.class);
     }
 
     public void setEnvelopedData(EnvelopedData signedData) {
-        setFieldAsAny(CONTENT, signedData);
+        setFieldAsAny(ContentInfoField.CONTENT, signedData);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedData.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedData.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedData.java
index d516e72..b305483 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedData.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/EnvelopedData.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.EnvelopedData.MyEnum.*;
-
 /**
  * EnvelopedData ::= SEQUENCE {
  *   version CMSVersion,
@@ -54,7 +52,7 @@ import static org.apache.kerby.cms.type.EnvelopedData.MyEnum.*;
  */
 public class EnvelopedData extends Asn1SequenceType {
 
-    protected enum MyEnum implements EnumType {
+    protected enum EnvelopedDataField implements EnumType {
         CMS_VERSION,
         ORIGINATOR_INFO,
         RECIPIENT_INFOS,
@@ -73,11 +71,11 @@ public class EnvelopedData extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new Asn1FieldInfo(CMS_VERSION, CmsVersion.class),
-            new ImplicitField(ORIGINATOR_INFO, 0, OriginatorInfo.class),
-            new Asn1FieldInfo(RECIPIENT_INFOS, RecipientInfos.class),
-            new Asn1FieldInfo(ENCRYPTED_CONTENT_INFO, EncryptedContentInfo.class),
-            new ImplicitField(UNPROTECTED_ATTRS, 1, UnprotectedAttributes.class)
+            new Asn1FieldInfo(EnvelopedDataField.CMS_VERSION, CmsVersion.class),
+            new ImplicitField(EnvelopedDataField.ORIGINATOR_INFO, 0, OriginatorInfo.class),
+            new Asn1FieldInfo(EnvelopedDataField.RECIPIENT_INFOS, RecipientInfos.class),
+            new Asn1FieldInfo(EnvelopedDataField.ENCRYPTED_CONTENT_INFO, EncryptedContentInfo.class),
+            new ImplicitField(EnvelopedDataField.UNPROTECTED_ATTRS, 1, UnprotectedAttributes.class)
     };
 
     public EnvelopedData() {
@@ -85,39 +83,39 @@ public class EnvelopedData extends Asn1SequenceType {
     }
 
     public CmsVersion getCmsVersion() {
-        return getFieldAs(CMS_VERSION, CmsVersion.class);
+        return getFieldAs(EnvelopedDataField.CMS_VERSION, CmsVersion.class);
     }
 
     public void setCmsVersion(CmsVersion cmsVersion) {
-        setFieldAs(CMS_VERSION, cmsVersion);
+        setFieldAs(EnvelopedDataField.CMS_VERSION, cmsVersion);
     }
 
     public OriginatorInfo getOriginatorInfo() {
-        return getFieldAs(ORIGINATOR_INFO, OriginatorInfo.class);
+        return getFieldAs(EnvelopedDataField.ORIGINATOR_INFO, OriginatorInfo.class);
     }
 
     public void setOriginatorInfo(OriginatorInfo originatorInfo) {
-        setFieldAs(ORIGINATOR_INFO, originatorInfo);
+        setFieldAs(EnvelopedDataField.ORIGINATOR_INFO, originatorInfo);
     }
     public RecipientInfos getRecipientInfos() {
-        return getFieldAs(RECIPIENT_INFOS, RecipientInfos.class);
+        return getFieldAs(EnvelopedDataField.RECIPIENT_INFOS, RecipientInfos.class);
     }
 
     public void setRecipientInfos(RecipientInfos recipientInfos) {
-        setFieldAs(RECIPIENT_INFOS, recipientInfos);
+        setFieldAs(EnvelopedDataField.RECIPIENT_INFOS, recipientInfos);
     }
     public EncryptedContentInfo getEncryptedContentInfo() {
-        return getFieldAs(ENCRYPTED_CONTENT_INFO, EncryptedContentInfo.class);
+        return getFieldAs(EnvelopedDataField.ENCRYPTED_CONTENT_INFO, EncryptedContentInfo.class);
     }
 
     public void setEncryptedContentInfo(EncryptedContentInfo encryptedContentInfo) {
-        setFieldAs(ENCRYPTED_CONTENT_INFO, encryptedContentInfo);
+        setFieldAs(EnvelopedDataField.ENCRYPTED_CONTENT_INFO, encryptedContentInfo);
     }
     public UnprotectedAttributes getUnprotectedAttributes() {
-        return getFieldAs(UNPROTECTED_ATTRS, UnprotectedAttributes.class);
+        return getFieldAs(EnvelopedDataField.UNPROTECTED_ATTRS, UnprotectedAttributes.class);
     }
 
     public void setUnprotectedAttributes(UnprotectedAttributes unprotectedAttributes) {
-        setFieldAs(UNPROTECTED_ATTRS, unprotectedAttributes);
+        setFieldAs(EnvelopedDataField.UNPROTECTED_ATTRS, unprotectedAttributes);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificate.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificate.java
index 8553796..46a7128 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificate.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificate.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.cms.type.ExtendedCertificate.MyEnum.*;
-
 /**
  * ExtendedCertificate ::= SEQUENCE {
  *   extendedCertificateInfo ExtendedCertificateInfo,
@@ -33,7 +31,7 @@ import static org.apache.kerby.cms.type.ExtendedCertificate.MyEnum.*;
  * }
  */
 public class ExtendedCertificate extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ExtendedCertificateField implements EnumType {
         EXTENDED_CERTIFICATE_INFO,
         SIGNATURE_ALGORITHMS,
         SIGNATURE;
@@ -50,9 +48,9 @@ public class ExtendedCertificate extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(EXTENDED_CERTIFICATE_INFO, ExtendedCertificateInfo.class),
-            new Asn1FieldInfo(SIGNATURE_ALGORITHMS, SignatureAlgorithmIdentifier.class),
-            new Asn1FieldInfo(SIGNATURE, Signature.class)
+            new Asn1FieldInfo(ExtendedCertificateField.EXTENDED_CERTIFICATE_INFO, ExtendedCertificateInfo.class),
+            new Asn1FieldInfo(ExtendedCertificateField.SIGNATURE_ALGORITHMS, SignatureAlgorithmIdentifier.class),
+            new Asn1FieldInfo(ExtendedCertificateField.SIGNATURE, Signature.class)
     };
 
     public ExtendedCertificate() {
@@ -60,26 +58,26 @@ public class ExtendedCertificate extends Asn1SequenceType {
     }
 
     public ExtendedCertificateInfo getExtendedCertificateInfo() {
-        return getFieldAs(EXTENDED_CERTIFICATE_INFO, ExtendedCertificateInfo.class);
+        return getFieldAs(ExtendedCertificateField.EXTENDED_CERTIFICATE_INFO, ExtendedCertificateInfo.class);
     }
 
     public void setExtendedCertificateInfo(ExtendedCertificateInfo extendedCertificateInfo) {
-        setFieldAs(EXTENDED_CERTIFICATE_INFO, extendedCertificateInfo);
+        setFieldAs(ExtendedCertificateField.EXTENDED_CERTIFICATE_INFO, extendedCertificateInfo);
     }
 
     public SignatureAlgorithmIdentifier getSignatureAlgorithmIdentifier() {
-        return getFieldAs(SIGNATURE_ALGORITHMS, SignatureAlgorithmIdentifier.class);
+        return getFieldAs(ExtendedCertificateField.SIGNATURE_ALGORITHMS, SignatureAlgorithmIdentifier.class);
     }
 
     public void setSignatureAlgorithmIdentifier(SignatureAlgorithmIdentifier signatureAlgorithmIdentifier) {
-        setFieldAs(SIGNATURE_ALGORITHMS, signatureAlgorithmIdentifier);
+        setFieldAs(ExtendedCertificateField.SIGNATURE_ALGORITHMS, signatureAlgorithmIdentifier);
     }
 
     public Signature getSignature() {
-        return getFieldAs(SIGNATURE, Signature.class);
+        return getFieldAs(ExtendedCertificateField.SIGNATURE, Signature.class);
     }
 
     public void setSignature(Signature signature) {
-        setFieldAs(SIGNATURE, signature);
+        setFieldAs(ExtendedCertificateField.SIGNATURE, signature);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificateInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificateInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificateInfo.java
index 1cd5d92..a091eed 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificateInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/ExtendedCertificateInfo.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.cms.type.ExtendedCertificateInfo.MyEnum.*;
-
 /**
  * ExtendedCertificateInfo ::= SEQUENCE {
  *   version CMSVersion,
@@ -33,7 +31,7 @@ import static org.apache.kerby.cms.type.ExtendedCertificateInfo.MyEnum.*;
  * }
  */
 public class ExtendedCertificateInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum ExtendedCertificateInfoField implements EnumType {
         CMS_VERSION,
         CERTIFICATE,
         ATTRIBUTES;
@@ -50,9 +48,9 @@ public class ExtendedCertificateInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(CMS_VERSION, CmsVersion.class),
-            new Asn1FieldInfo(CERTIFICATE, SignatureAlgorithmIdentifier.class),
-            new Asn1FieldInfo(ATTRIBUTES, Signature.class)
+            new Asn1FieldInfo(ExtendedCertificateInfoField.CMS_VERSION, CmsVersion.class),
+            new Asn1FieldInfo(ExtendedCertificateInfoField.CERTIFICATE, SignatureAlgorithmIdentifier.class),
+            new Asn1FieldInfo(ExtendedCertificateInfoField.ATTRIBUTES, Signature.class)
     };
 
     public ExtendedCertificateInfo() {
@@ -60,27 +58,27 @@ public class ExtendedCertificateInfo extends Asn1SequenceType {
     }
 
     public CmsVersion getCmsVersion() {
-        return getFieldAs(CMS_VERSION, CmsVersion.class);
+        return getFieldAs(ExtendedCertificateInfoField.CMS_VERSION, CmsVersion.class);
     }
 
     public void setCmsVersion(CmsVersion version) {
-        setFieldAs(CMS_VERSION, version);
+        setFieldAs(ExtendedCertificateInfoField.CMS_VERSION, version);
     }
 
     public SignatureAlgorithmIdentifier getCertificate() {
-        return getFieldAs(CERTIFICATE, SignatureAlgorithmIdentifier.class);
+        return getFieldAs(ExtendedCertificateInfoField.CERTIFICATE, SignatureAlgorithmIdentifier.class);
     }
 
     public void setCertificate(SignatureAlgorithmIdentifier signatureAlgorithmIdentifier) {
-        setFieldAs(CERTIFICATE, signatureAlgorithmIdentifier);
+        setFieldAs(ExtendedCertificateInfoField.CERTIFICATE, signatureAlgorithmIdentifier);
     }
 
     public Signature getAttributes() {
-        return getFieldAs(ATTRIBUTES, Signature.class);
+        return getFieldAs(ExtendedCertificateInfoField.ATTRIBUTES, Signature.class);
     }
 
     public void setAttributes(Signature signature) {
-        setFieldAs(ATTRIBUTES, signature);
+        setFieldAs(ExtendedCertificateInfoField.ATTRIBUTES, signature);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/IssuerAndSerialNumber.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/IssuerAndSerialNumber.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/IssuerAndSerialNumber.java
index 55c0025..a4aec74 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/IssuerAndSerialNumber.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/IssuerAndSerialNumber.java
@@ -25,8 +25,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.cms.type.IssuerAndSerialNumber.MyEnum.*;
-
 /**
  * Ref. RFC5652
  * <pre>
@@ -39,7 +37,7 @@ import static org.apache.kerby.cms.type.IssuerAndSerialNumber.MyEnum.*;
  * </pre>
  */
 public class IssuerAndSerialNumber extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum IssuerAndSerialNumberField implements EnumType {
         ISSUER,
         SERIAL_NUMBER;
 
@@ -55,8 +53,8 @@ public class IssuerAndSerialNumber extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-        new Asn1FieldInfo(ISSUER, Name.class),
-        new Asn1FieldInfo(SERIAL_NUMBER, Asn1Integer.class)
+        new Asn1FieldInfo(IssuerAndSerialNumberField.ISSUER, Name.class),
+        new Asn1FieldInfo(IssuerAndSerialNumberField.SERIAL_NUMBER, Asn1Integer.class)
     };
 
     public IssuerAndSerialNumber() {
@@ -64,18 +62,18 @@ public class IssuerAndSerialNumber extends Asn1SequenceType {
     }
 
     public Name getIssuer() {
-        return getFieldAs(ISSUER, Name.class);
+        return getFieldAs(IssuerAndSerialNumberField.ISSUER, Name.class);
     }
 
     public void setIssuer(Name name) {
-        setFieldAs(ISSUER, name);
+        setFieldAs(IssuerAndSerialNumberField.ISSUER, name);
     }
 
     public Asn1Integer getSerialNumber() {
-        return getFieldAs(SERIAL_NUMBER, Asn1Integer.class);
+        return getFieldAs(IssuerAndSerialNumberField.SERIAL_NUMBER, Asn1Integer.class);
     }
 
     public void setSerialNumber(int serialNumber) {
-        setFieldAsInt(SERIAL_NUMBER, serialNumber);
+        setFieldAsInt(IssuerAndSerialNumberField.SERIAL_NUMBER, serialNumber);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKIdentifier.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKIdentifier.java
index aa8467c..2e7c0c2 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKIdentifier.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKIdentifier.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.type.Asn1GeneralizedTime;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.KEKIdentifier.MyEnum.*;
-
 /**
  * KEKIdentifier ::= SEQUENCE {
  *   keyIdentifier OCTET STRING,
@@ -34,7 +32,7 @@ import static org.apache.kerby.cms.type.KEKIdentifier.MyEnum.*;
  *   other OtherKeyAttribute OPTIONAL }
  */
 public class KEKIdentifier extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KEKIdentifierField implements EnumType {
         KEY_IDENTIFIER,
         DATE,
         OTHER;
@@ -51,9 +49,9 @@ public class KEKIdentifier extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(KEY_IDENTIFIER, Asn1OctetString.class),
-            new Asn1FieldInfo(DATE, Asn1GeneralizedTime.class),
-            new Asn1FieldInfo(OTHER, OtherKeyAttribute.class)
+            new Asn1FieldInfo(KEKIdentifierField.KEY_IDENTIFIER, Asn1OctetString.class),
+            new Asn1FieldInfo(KEKIdentifierField.DATE, Asn1GeneralizedTime.class),
+            new Asn1FieldInfo(KEKIdentifierField.OTHER, OtherKeyAttribute.class)
     };
 
     public KEKIdentifier() {
@@ -61,26 +59,26 @@ public class KEKIdentifier extends Asn1SequenceType {
     }
 
     public Asn1OctetString getKeyIdentifier() {
-        return getFieldAs(KEY_IDENTIFIER, Asn1OctetString.class);
+        return getFieldAs(KEKIdentifierField.KEY_IDENTIFIER, Asn1OctetString.class);
     }
 
     public void setKeyIdentifier(Asn1OctetString keyIdentifier) {
-        setFieldAs(KEY_IDENTIFIER, keyIdentifier);
+        setFieldAs(KEKIdentifierField.KEY_IDENTIFIER, keyIdentifier);
     }
 
     public Asn1GeneralizedTime getDate() {
-        return getFieldAs(DATE, Asn1GeneralizedTime.class);
+        return getFieldAs(KEKIdentifierField.DATE, Asn1GeneralizedTime.class);
     }
 
     public void setDate(Asn1GeneralizedTime date) {
-        setFieldAs(DATE, date);
+        setFieldAs(KEKIdentifierField.DATE, date);
     }
 
     public OtherKeyAttribute getOther() {
-        return getFieldAs(OTHER, OtherKeyAttribute.class);
+        return getFieldAs(KEKIdentifierField.OTHER, OtherKeyAttribute.class);
     }
 
     public void setOther(OtherKeyAttribute other) {
-        setFieldAs(OTHER, other);
+        setFieldAs(KEKIdentifierField.OTHER, other);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKRecipientInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKRecipientInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKRecipientInfo.java
index 87d9528..402cad8 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKRecipientInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KEKRecipientInfo.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.cms.type.KEKRecipientInfo.MyEnum.*;
-
 /**
  * KEKRecipientInfo ::= SEQUENCE {
  *   version CMSVersion,  -- always set to 4
@@ -33,7 +31,7 @@ import static org.apache.kerby.cms.type.KEKRecipientInfo.MyEnum.*;
  *   encryptedKey EncryptedKey }
  */
 public class KEKRecipientInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KEKRecipientInfoField implements EnumType {
         VERSION,
         KE_KID,
         KEY_ENCRYPTION_ALGORITHM,
@@ -51,10 +49,10 @@ public class KEKRecipientInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(VERSION, CmsVersion.class),
-            new Asn1FieldInfo(KE_KID, KEKIdentifier.class),
-            new Asn1FieldInfo(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
-            new Asn1FieldInfo(ENCRYPTED_KEY, EncryptedKey.class)
+            new Asn1FieldInfo(KEKRecipientInfoField.VERSION, CmsVersion.class),
+            new Asn1FieldInfo(KEKRecipientInfoField.KE_KID, KEKIdentifier.class),
+            new Asn1FieldInfo(KEKRecipientInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
+            new Asn1FieldInfo(KEKRecipientInfoField.ENCRYPTED_KEY, EncryptedKey.class)
     };
 
     public KEKRecipientInfo() {
@@ -62,35 +60,35 @@ public class KEKRecipientInfo extends Asn1SequenceType {
     }
 
     public CmsVersion getVersion() {
-        return getFieldAs(VERSION, CmsVersion.class);
+        return getFieldAs(KEKRecipientInfoField.VERSION, CmsVersion.class);
     }
 
     public void setVersion(CmsVersion version) {
-        setFieldAs(VERSION, version);
+        setFieldAs(KEKRecipientInfoField.VERSION, version);
     }
 
     public KEKIdentifier getKEKIdentifier() {
-        return getFieldAs(KE_KID, KEKIdentifier.class);
+        return getFieldAs(KEKRecipientInfoField.KE_KID, KEKIdentifier.class);
     }
 
     public void setKEKIdentifier(KEKIdentifier kekIdentifier) {
-        setFieldAs(KE_KID, kekIdentifier);
+        setFieldAs(KEKRecipientInfoField.KE_KID, kekIdentifier);
     }
 
     public KeyEncryptionAlgorithmIdentifier getKeyEncryptionAlgorithmIdentifier() {
-        return getFieldAs(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
+        return getFieldAs(KEKRecipientInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
     }
 
     public void setKeyEncryptionAlgorithmIdentifier(KeyEncryptionAlgorithmIdentifier
                                                             keyEncryptionAlgorithmIdentifier) {
-        setFieldAs(KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
+        setFieldAs(KEKRecipientInfoField.KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
     }
 
     public EncryptedKey getEncryptedKey() {
-        return getFieldAs(ENCRYPTED_KEY, EncryptedKey.class);
+        return getFieldAs(KEKRecipientInfoField.ENCRYPTED_KEY, EncryptedKey.class);
     }
 
     public void setEncryptedKey(EncryptedKey encryptedKey) {
-        setFieldAs(ENCRYPTED_KEY, encryptedKey);
+        setFieldAs(KEKRecipientInfoField.ENCRYPTED_KEY, encryptedKey);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientIdentifier.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientIdentifier.java
index 7f41001..6368a12 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientIdentifier.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientIdentifier.java
@@ -24,15 +24,13 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 
-import static org.apache.kerby.cms.type.KeyAgreeRecipientIdentifier.MyEnum.*;
-
 /**
  * KeyAgreeRecipientIdentifier ::= CHOICE {
  *   issuerAndSerialNumber IssuerAndSerialNumber,
  *   rKeyId [0] IMPLICIT RecipientKeyIdentifier }
  */
 public class KeyAgreeRecipientIdentifier extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum KeyAgreeRecipientIdentifierField implements EnumType {
         ISSUER_AND_SERIAL_NUMBER,
         R_KEY_ID;
 
@@ -48,8 +46,8 @@ public class KeyAgreeRecipientIdentifier extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new Asn1FieldInfo(ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class),
-            new ImplicitField(R_KEY_ID, 0, RecipientKeyIdentifier.class)
+            new Asn1FieldInfo(KeyAgreeRecipientIdentifierField.ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class),
+            new ImplicitField(KeyAgreeRecipientIdentifierField.R_KEY_ID, 0, RecipientKeyIdentifier.class)
     };
 
     public KeyAgreeRecipientIdentifier() {
@@ -57,18 +55,18 @@ public class KeyAgreeRecipientIdentifier extends Asn1Choice {
     }
 
     public IssuerAndSerialNumber getIssuerAndSerialNumber() {
-        return getChoiceValueAs(ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class);
+        return getChoiceValueAs(KeyAgreeRecipientIdentifierField.ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class);
     }
 
     public void setIssuerAndSerialNumber(IssuerAndSerialNumber issuerAndSerialNumber) {
-        setChoiceValue(ISSUER_AND_SERIAL_NUMBER, issuerAndSerialNumber);
+        setChoiceValue(KeyAgreeRecipientIdentifierField.ISSUER_AND_SERIAL_NUMBER, issuerAndSerialNumber);
     }
 
     public RecipientKeyIdentifier getRecipientKeyIdentifier() {
-        return getChoiceValueAs(R_KEY_ID, RecipientKeyIdentifier.class);
+        return getChoiceValueAs(KeyAgreeRecipientIdentifierField.R_KEY_ID, RecipientKeyIdentifier.class);
     }
 
     public void setRecipientKeyIdentifier(RecipientKeyIdentifier recipientKeyIdentifier) {
-        setChoiceValue(R_KEY_ID, recipientKeyIdentifier);
+        setChoiceValue(KeyAgreeRecipientIdentifierField.R_KEY_ID, recipientKeyIdentifier);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientInfo.java
index 509d1f9..b65d248 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyAgreeRecipientInfo.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.KeyAgreeRecipientInfo.MyEnum.*;
-
 /**
  * KeyAgreeRecipientInfo ::= SEQUENCE {
  *   version CMSVersion,  -- always set to 3
@@ -38,7 +36,7 @@ import static org.apache.kerby.cms.type.KeyAgreeRecipientInfo.MyEnum.*;
  * UserKeyingMaterial ::= OCTET STRING
  */
 public class KeyAgreeRecipientInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KARInfoField implements EnumType {
         VERSION,
         ORIGINATOR,
         UKM,
@@ -57,11 +55,11 @@ public class KeyAgreeRecipientInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(VERSION, CmsVersion.class),
-            new ExplicitField(ORIGINATOR, 0, OriginatorIdentifierOrKey.class),
-            new ExplicitField(UKM, 1, Asn1OctetString.class),
-            new Asn1FieldInfo(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
-            new Asn1FieldInfo(RECIPIENT_ENCRYPTED_KEY, RecipientEncryptedKeys.class)
+            new Asn1FieldInfo(KARInfoField.VERSION, CmsVersion.class),
+            new ExplicitField(KARInfoField.ORIGINATOR, 0, OriginatorIdentifierOrKey.class),
+            new ExplicitField(KARInfoField.UKM, 1, Asn1OctetString.class),
+            new Asn1FieldInfo(KARInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
+            new Asn1FieldInfo(KARInfoField.RECIPIENT_ENCRYPTED_KEY, RecipientEncryptedKeys.class)
     };
 
     public KeyAgreeRecipientInfo() {
@@ -69,43 +67,43 @@ public class KeyAgreeRecipientInfo extends Asn1SequenceType {
     }
 
     public CmsVersion getVersion() {
-        return getFieldAs(VERSION, CmsVersion.class);
+        return getFieldAs(KARInfoField.VERSION, CmsVersion.class);
     }
 
     public void setVersion(CmsVersion version) {
-        setFieldAs(VERSION, version);
+        setFieldAs(KARInfoField.VERSION, version);
     }
 
     public OriginatorIdentifierOrKey getOriginator() {
-        return getFieldAs(ORIGINATOR, OriginatorIdentifierOrKey.class);
+        return getFieldAs(KARInfoField.ORIGINATOR, OriginatorIdentifierOrKey.class);
     }
 
     public void setOriginator(OriginatorIdentifierOrKey originator) {
-        setFieldAs(ORIGINATOR, originator);
+        setFieldAs(KARInfoField.ORIGINATOR, originator);
     }
 
     public Asn1OctetString getUkm() {
-        return getFieldAs(UKM, Asn1OctetString.class);
+        return getFieldAs(KARInfoField.UKM, Asn1OctetString.class);
     }
 
     public void setUkm(Asn1OctetString ukm) {
-        setFieldAs(UKM, ukm);
+        setFieldAs(KARInfoField.UKM, ukm);
     }
 
     public KeyEncryptionAlgorithmIdentifier getKeyEncryptionAlgorithmIdentifier() {
-        return getFieldAs(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
+        return getFieldAs(KARInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
     }
 
     public void setkeyEncryptionAlgorithmIdentifier(KeyEncryptionAlgorithmIdentifier
                                                             keyEncryptionAlgorithmIdentifier) {
-        setFieldAs(KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
+        setFieldAs(KARInfoField.KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
     }
 
     public RecipientEncryptedKeys getRecipientEncryptedKeys() {
-        return getFieldAs(RECIPIENT_ENCRYPTED_KEY, RecipientEncryptedKeys.class);
+        return getFieldAs(KARInfoField.RECIPIENT_ENCRYPTED_KEY, RecipientEncryptedKeys.class);
     }
 
     public void setRecipientEncryptedKeys(RecipientEncryptedKeys recipientEncryptedKeys) {
-        setFieldAs(RECIPIENT_ENCRYPTED_KEY, recipientEncryptedKeys);
+        setFieldAs(KARInfoField.RECIPIENT_ENCRYPTED_KEY, recipientEncryptedKeys);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyTransRecipientInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyTransRecipientInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyTransRecipientInfo.java
index 07c3c75..a22c17b 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyTransRecipientInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/KeyTransRecipientInfo.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.cms.type.KeyTransRecipientInfo.MyEnum.*;
-
 /**
  * KeyTransRecipientInfo ::= SEQUENCE {
  *   version CMSVersion,  -- always set to 0 or 2
@@ -33,7 +31,7 @@ import static org.apache.kerby.cms.type.KeyTransRecipientInfo.MyEnum.*;
  *   encryptedKey EncryptedKey }
  */
 public class KeyTransRecipientInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KTRInfoField implements EnumType {
         VERSION,
         RID,
         KEY_ENCRYPTION_ALGORITHM,
@@ -51,10 +49,10 @@ public class KeyTransRecipientInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(VERSION, CmsVersion.class),
-            new Asn1FieldInfo(RID, RecipientIdentifier.class),
-            new Asn1FieldInfo(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
-            new Asn1FieldInfo(ENCRYPTED_KEY, EncryptedKey.class)
+            new Asn1FieldInfo(KTRInfoField.VERSION, CmsVersion.class),
+            new Asn1FieldInfo(KTRInfoField.RID, RecipientIdentifier.class),
+            new Asn1FieldInfo(KTRInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class),
+            new Asn1FieldInfo(KTRInfoField.ENCRYPTED_KEY, EncryptedKey.class)
     };
 
     public KeyTransRecipientInfo() {
@@ -62,35 +60,35 @@ public class KeyTransRecipientInfo extends Asn1SequenceType {
     }
 
     public CmsVersion getVersion() {
-        return getFieldAs(VERSION, CmsVersion.class);
+        return getFieldAs(KTRInfoField.VERSION, CmsVersion.class);
     }
 
     public void setVersion(CmsVersion version) {
-        setFieldAs(VERSION, version);
+        setFieldAs(KTRInfoField.VERSION, version);
     }
 
     public RecipientIdentifier getRid() {
-        return getFieldAs(RID, RecipientIdentifier.class);
+        return getFieldAs(KTRInfoField.RID, RecipientIdentifier.class);
     }
 
     public void setRid(RecipientIdentifier rid) {
-        setFieldAs(RID, rid);
+        setFieldAs(KTRInfoField.RID, rid);
     }
 
     public KeyEncryptionAlgorithmIdentifier getKeyEncryptionAlgorithmIdentifier() {
-        return getFieldAs(KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
+        return getFieldAs(KTRInfoField.KEY_ENCRYPTION_ALGORITHM, KeyEncryptionAlgorithmIdentifier.class);
     }
 
     public void setKeyEncryptionAlgorithmIdentifier(KeyEncryptionAlgorithmIdentifier
                                                             keyEncryptionAlgorithmIdentifier) {
-        setFieldAs(KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
+        setFieldAs(KTRInfoField.KEY_ENCRYPTION_ALGORITHM, keyEncryptionAlgorithmIdentifier);
     }
 
     public EncryptedKey getEncryptedKey() {
-        return getFieldAs(ENCRYPTED_KEY, EncryptedKey.class);
+        return getFieldAs(KTRInfoField.ENCRYPTED_KEY, EncryptedKey.class);
     }
 
     public void setEncryptedKey(EncryptedKey encryptedKey) {
-        setFieldAs(ENCRYPTED_KEY, encryptedKey);
+        setFieldAs(KTRInfoField.ENCRYPTED_KEY, encryptedKey);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorIdentifierOrKey.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorIdentifierOrKey.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorIdentifierOrKey.java
index b4aa436..fe3de73 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorIdentifierOrKey.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorIdentifierOrKey.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1Choice;
 import org.apache.kerby.x509.type.SubjectKeyIdentifier;
 
-import static org.apache.kerby.cms.type.OriginatorIdentifierOrKey.MyEnum.*;
-
 /**
  * OriginatorIdentifierOrKey ::= CHOICE {
  *   issuerAndSerialNumber IssuerAndSerialNumber,
@@ -34,7 +32,7 @@ import static org.apache.kerby.cms.type.OriginatorIdentifierOrKey.MyEnum.*;
  *   originatorKey [1] OriginatorPublicKey }
  */
 public class OriginatorIdentifierOrKey extends Asn1Choice {
-    protected enum MyEnum implements EnumType {
+    protected enum OriginatorIdentifierOrKeyField implements EnumType {
         ISSUER_AND_SERIAL_NUMBER,
         SUBJECT_KEY_IDENTIFIER,
         ORIGINATOR_KEY;
@@ -51,9 +49,9 @@ public class OriginatorIdentifierOrKey extends Asn1Choice {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new Asn1FieldInfo(ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class),
-            new ImplicitField(SUBJECT_KEY_IDENTIFIER, 0, SubjectKeyIdentifier.class),
-            new ImplicitField(ORIGINATOR_KEY, 1, OriginatorPublicKey.class)
+            new Asn1FieldInfo(OriginatorIdentifierOrKeyField.ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class),
+            new ImplicitField(OriginatorIdentifierOrKeyField.SUBJECT_KEY_IDENTIFIER, 0, SubjectKeyIdentifier.class),
+            new ImplicitField(OriginatorIdentifierOrKeyField.ORIGINATOR_KEY, 1, OriginatorPublicKey.class)
     };
 
     public OriginatorIdentifierOrKey() {
@@ -61,26 +59,26 @@ public class OriginatorIdentifierOrKey extends Asn1Choice {
     }
 
     public IssuerAndSerialNumber getIssuerAndSerialNumber() {
-        return getChoiceValueAs(ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class);
+        return getChoiceValueAs(OriginatorIdentifierOrKeyField.ISSUER_AND_SERIAL_NUMBER, IssuerAndSerialNumber.class);
     }
 
     public void setIssuerAndSerialNumber(IssuerAndSerialNumber issuerAndSerialNumber) {
-        setChoiceValue(ISSUER_AND_SERIAL_NUMBER, issuerAndSerialNumber);
+        setChoiceValue(OriginatorIdentifierOrKeyField.ISSUER_AND_SERIAL_NUMBER, issuerAndSerialNumber);
     }
 
     public SubjectKeyIdentifier getSubjectKeyIdentifier() {
-        return getChoiceValueAs(SUBJECT_KEY_IDENTIFIER, SubjectKeyIdentifier.class);
+        return getChoiceValueAs(OriginatorIdentifierOrKeyField.SUBJECT_KEY_IDENTIFIER, SubjectKeyIdentifier.class);
     }
 
     public void setSubjectKeyIdentifier(SubjectKeyIdentifier subjectKeyIdentifier) {
-        setChoiceValue(SUBJECT_KEY_IDENTIFIER, subjectKeyIdentifier);
+        setChoiceValue(OriginatorIdentifierOrKeyField.SUBJECT_KEY_IDENTIFIER, subjectKeyIdentifier);
     }
 
     public OriginatorPublicKey getOriginatorPublicKey() {
-        return getChoiceValueAs(ORIGINATOR_KEY, OriginatorPublicKey.class);
+        return getChoiceValueAs(OriginatorIdentifierOrKeyField.ORIGINATOR_KEY, OriginatorPublicKey.class);
     }
 
     public void setOriginatorPublicKey(OriginatorPublicKey originatorPublicKey) {
-        setChoiceValue(ORIGINATOR_KEY, originatorPublicKey);
+        setChoiceValue(OriginatorIdentifierOrKeyField.ORIGINATOR_KEY, originatorPublicKey);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorInfo.java
index 7e9d2ba..f59a690 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorInfo.java
@@ -24,8 +24,6 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ImplicitField;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 
-import static org.apache.kerby.cms.type.OriginatorInfo.MyEnum.*;
-
 /**
  * OriginatorInfo ::= SEQUENCE {
  *   certs [0] IMPLICIT CertificateSet OPTIONAL,
@@ -33,7 +31,7 @@ import static org.apache.kerby.cms.type.OriginatorInfo.MyEnum.*;
  * }
  */
 public class OriginatorInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OriginatorInfoField implements EnumType {
         CERTS,
         CRLS;
 
@@ -49,8 +47,8 @@ public class OriginatorInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new ImplicitField(CERTS, CertificateSet.class),
-            new ImplicitField(CRLS, RevocationInfoChoices.class)
+            new ImplicitField(OriginatorInfoField.CERTS, CertificateSet.class),
+            new ImplicitField(OriginatorInfoField.CRLS, RevocationInfoChoices.class)
     };
 
     public OriginatorInfo() {
@@ -58,18 +56,18 @@ public class OriginatorInfo extends Asn1SequenceType {
     }
 
     public CertificateSet getCerts() {
-        return getFieldAs(CERTS, CertificateSet.class);
+        return getFieldAs(OriginatorInfoField.CERTS, CertificateSet.class);
     }
 
     public void setCerts(CertificateSet certs) {
-        setFieldAs(CERTS, certs);
+        setFieldAs(OriginatorInfoField.CERTS, certs);
     }
 
     public RevocationInfoChoices getCrls() {
-        return getFieldAs(CRLS, RevocationInfoChoices.class);
+        return getFieldAs(OriginatorInfoField.CRLS, RevocationInfoChoices.class);
     }
 
     public void setCrls(RevocationInfoChoices crls) {
-        setFieldAs(CRLS, crls);
+        setFieldAs(OriginatorInfoField.CRLS, crls);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorPublicKey.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorPublicKey.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorPublicKey.java
index 4dc23b9..24bc97c 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorPublicKey.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OriginatorPublicKey.java
@@ -25,15 +25,13 @@ import org.apache.kerby.asn1.type.Asn1BitString;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
 import org.apache.kerby.x509.type.AlgorithmIdentifier;
 
-import static org.apache.kerby.cms.type.OriginatorPublicKey.MyEnum.*;
-
 /**
  * OriginatorPublicKey ::= SEQUENCE {
  *   algorithm AlgorithmIdentifier,
  *   publicKey BIT STRING }
  */
 public class OriginatorPublicKey extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OriginatorPublicKeyField implements EnumType {
         ALGORITHM,
         PUBLIC_KEY;
 
@@ -49,8 +47,8 @@ public class OriginatorPublicKey extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(ALGORITHM, AlgorithmIdentifier.class),
-            new Asn1FieldInfo(PUBLIC_KEY, Asn1BitString.class)
+            new Asn1FieldInfo(OriginatorPublicKeyField.ALGORITHM, AlgorithmIdentifier.class),
+            new Asn1FieldInfo(OriginatorPublicKeyField.PUBLIC_KEY, Asn1BitString.class)
     };
 
     public OriginatorPublicKey() {
@@ -58,18 +56,18 @@ public class OriginatorPublicKey extends Asn1SequenceType {
     }
 
     public AlgorithmIdentifier getAlgorithm() {
-        return getFieldAs(ALGORITHM, AlgorithmIdentifier.class);
+        return getFieldAs(OriginatorPublicKeyField.ALGORITHM, AlgorithmIdentifier.class);
     }
 
     public void setAlgorithm(AlgorithmIdentifier algorithm) {
-        setFieldAs(ALGORITHM, algorithm);
+        setFieldAs(OriginatorPublicKeyField.ALGORITHM, algorithm);
     }
 
     public Asn1BitString getPublicKey() {
-        return getFieldAs(PUBLIC_KEY, Asn1BitString.class);
+        return getFieldAs(OriginatorPublicKeyField.PUBLIC_KEY, Asn1BitString.class);
     }
 
     public void setPublicKey(Asn1BitString publicKey) {
-        setFieldAs(PUBLIC_KEY, publicKey);
+        setFieldAs(OriginatorPublicKeyField.PUBLIC_KEY, publicKey);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherCertificateFormat.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherCertificateFormat.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherCertificateFormat.java
index 11b302c..01704fa 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherCertificateFormat.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherCertificateFormat.java
@@ -26,8 +26,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.cms.type.OtherCertificateFormat.MyEnum.*;
-
 /**
  * OtherCertificateFormat ::= SEQUENCE {
  *   otherCertFormat OBJECT IDENTIFIER,
@@ -35,7 +33,7 @@ import static org.apache.kerby.cms.type.OtherCertificateFormat.MyEnum.*;
  * }
  */
 public class OtherCertificateFormat extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtherCertificateFormatField implements EnumType {
         OTHER_CERT_FORMAT,
         OTHER_CERT;
 
@@ -51,8 +49,8 @@ public class OtherCertificateFormat extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(OTHER_CERT_FORMAT, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(OTHER_CERT, Asn1Any.class),
+            new Asn1FieldInfo(OtherCertificateFormatField.OTHER_CERT_FORMAT, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(OtherCertificateFormatField.OTHER_CERT, Asn1Any.class),
     };
 
     public OtherCertificateFormat() {
@@ -60,18 +58,18 @@ public class OtherCertificateFormat extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getOtherCertFormat() {
-        return getFieldAs(OTHER_CERT_FORMAT, Asn1ObjectIdentifier.class);
+        return getFieldAs(OtherCertificateFormatField.OTHER_CERT_FORMAT, Asn1ObjectIdentifier.class);
     }
 
     public void setOtherCertFormat(Asn1ObjectIdentifier otherCertFormat) {
-        setFieldAs(OTHER_CERT_FORMAT, otherCertFormat);
+        setFieldAs(OtherCertificateFormatField.OTHER_CERT_FORMAT, otherCertFormat);
     }
 
     public <T extends Asn1Type> T getOtherCertAs(Class<T> t) {
-        return getFieldAsAny(OTHER_CERT, t);
+        return getFieldAsAny(OtherCertificateFormatField.OTHER_CERT, t);
     }
 
     public void setOtherCert(Asn1Type otherCert) {
-        setFieldAsAny(OTHER_CERT, otherCert);
+        setFieldAsAny(OtherCertificateFormatField.OTHER_CERT, otherCert);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherKeyAttribute.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherKeyAttribute.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherKeyAttribute.java
index 3b95d4e..e25dcd7 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherKeyAttribute.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherKeyAttribute.java
@@ -26,15 +26,13 @@ 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.cms.type.OtherKeyAttribute.MyEnum.*;
-
 /**
  * OtherKeyAttribute ::= SEQUENCE {
  *   keyAttrId OBJECT IDENTIFIER,
  *   keyAttr ANY DEFINED BY keyAttrId OPTIONAL }
  */
 public class OtherKeyAttribute extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtherKeyAttributeField implements EnumType {
         KEY_ATTR_ID,
         KEY_ATTR;
 
@@ -50,8 +48,8 @@ public class OtherKeyAttribute extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(KEY_ATTR_ID, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(KEY_ATTR, Asn1Any.class)
+            new Asn1FieldInfo(OtherKeyAttributeField.KEY_ATTR_ID, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(OtherKeyAttributeField.KEY_ATTR, Asn1Any.class)
     };
 
     public OtherKeyAttribute() {
@@ -59,18 +57,18 @@ public class OtherKeyAttribute extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getAlgorithm() {
-        return getFieldAs(KEY_ATTR_ID, Asn1ObjectIdentifier.class);
+        return getFieldAs(OtherKeyAttributeField.KEY_ATTR_ID, Asn1ObjectIdentifier.class);
     }
 
     public void setAlgorithm(Asn1ObjectIdentifier keyAttrId) {
-        setFieldAs(KEY_ATTR_ID, keyAttrId);
+        setFieldAs(OtherKeyAttributeField.KEY_ATTR_ID, keyAttrId);
     }
 
     public <T extends Asn1Type> T getKeyAttrAs(Class<T> t) {
-        return getFieldAsAny(KEY_ATTR, t);
+        return getFieldAsAny(OtherKeyAttributeField.KEY_ATTR, t);
     }
 
     public void setKeyAttr(Asn1Type keyAttr) {
-        setFieldAsAny(KEY_ATTR, keyAttr);
+        setFieldAsAny(OtherKeyAttributeField.KEY_ATTR, keyAttr);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRecipientInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRecipientInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRecipientInfo.java
index 4032a3d..c60bb44 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRecipientInfo.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRecipientInfo.java
@@ -26,15 +26,13 @@ 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.cms.type.OtherRecipientInfo.MyEnum.*;
-
 /**
  * OtherRecipientInfo ::= SEQUENCE {
  *   oriType OBJECT IDENTIFIER,
  *   oriValue ANY DEFINED BY oriType }
  */
 public class OtherRecipientInfo extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtherRecipientInfoField implements EnumType {
         ORI_TYPE,
         ORI_VALUE;
 
@@ -50,8 +48,8 @@ public class OtherRecipientInfo extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(ORI_TYPE, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(ORI_VALUE, Asn1Any.class)
+            new Asn1FieldInfo(OtherRecipientInfoField.ORI_TYPE, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(OtherRecipientInfoField.ORI_VALUE, Asn1Any.class)
     };
 
     public OtherRecipientInfo() {
@@ -59,18 +57,18 @@ public class OtherRecipientInfo extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getOriType() {
-        return getFieldAs(ORI_TYPE, Asn1ObjectIdentifier.class);
+        return getFieldAs(OtherRecipientInfoField.ORI_TYPE, Asn1ObjectIdentifier.class);
     }
 
     public void setOriType(Asn1ObjectIdentifier oriType) {
-        setFieldAs(ORI_TYPE, oriType);
+        setFieldAs(OtherRecipientInfoField.ORI_TYPE, oriType);
     }
 
     public Asn1BitString getPublicKey() {
-        return getFieldAs(ORI_VALUE, Asn1BitString.class);
+        return getFieldAs(OtherRecipientInfoField.ORI_VALUE, Asn1BitString.class);
     }
 
     public void setOriValue(Asn1BitString oriValue) {
-        setFieldAs(ORI_VALUE, oriValue);
+        setFieldAs(OtherRecipientInfoField.ORI_VALUE, oriValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/2fd8e119/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRevocationInfoFormat.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRevocationInfoFormat.java b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRevocationInfoFormat.java
index abbf9d3..8ccddcb 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRevocationInfoFormat.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/cms/type/OtherRevocationInfoFormat.java
@@ -26,8 +26,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.cms.type.OtherRevocationInfoFormat.MyEnum.*;
-
 /**
  * OtherRevocationInfoFormat ::= SEQUENCE {
  *   otherRevInfoFormat OBJECT IDENTIFIER,
@@ -35,7 +33,7 @@ import static org.apache.kerby.cms.type.OtherRevocationInfoFormat.MyEnum.*;
  * }
  */
 public class OtherRevocationInfoFormat extends Asn1SequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum OtherRevocationInfoFormatField implements EnumType {
         OTHER_REV_INFO_FORMAT,
         OTHER_REV_INFO;
 
@@ -51,8 +49,8 @@ public class OtherRevocationInfoFormat extends Asn1SequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(OTHER_REV_INFO_FORMAT, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(OTHER_REV_INFO, Asn1Any.class)
+            new Asn1FieldInfo(OtherRevocationInfoFormatField.OTHER_REV_INFO_FORMAT, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(OtherRevocationInfoFormatField.OTHER_REV_INFO, Asn1Any.class)
     };
 
     public OtherRevocationInfoFormat() {
@@ -60,18 +58,18 @@ public class OtherRevocationInfoFormat extends Asn1SequenceType {
     }
 
     public Asn1ObjectIdentifier getOtherRevInfoFormat() {
-        return getFieldAs(OTHER_REV_INFO_FORMAT, Asn1ObjectIdentifier.class);
+        return getFieldAs(OtherRevocationInfoFormatField.OTHER_REV_INFO_FORMAT, Asn1ObjectIdentifier.class);
     }
 
     public void setOtherRevInfoFormat(Asn1ObjectIdentifier otherRevInfoFormat) {
-        setFieldAs(OTHER_REV_INFO_FORMAT, otherRevInfoFormat);
+        setFieldAs(OtherRevocationInfoFormatField.OTHER_REV_INFO_FORMAT, otherRevInfoFormat);
     }
 
     public <T extends Asn1Type> T getOtherRevInfoAs(Class<T> t) {
-        return getFieldAsAny(OTHER_REV_INFO, t);
+        return getFieldAsAny(OtherRevocationInfoFormatField.OTHER_REV_INFO, t);
     }
 
     public void setOtherRevInfo(Asn1Type otherRevInfo) {
-        setFieldAsAny(OTHER_REV_INFO, otherRevInfo);
+        setFieldAsAny(OtherRevocationInfoFormatField.OTHER_REV_INFO, otherRevInfo);
     }
 }


Mime
View raw message