You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dr...@apache.org on 2015/11/27 07:50:19 UTC

[3/3] directory-kerby git commit: DIRKRB-473. Initially added X509 ASN1 types

DIRKRB-473. Initially added X509 ASN1 types


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

Branch: refs/heads/master
Commit: 93bcd6fe561fe1a246a97cb00e9257282e02b098
Parents: 0cac182
Author: Kai Zheng <ka...@intel.com>
Authored: Fri Nov 27 14:49:52 2015 +0800
Committer: Kai Zheng <ka...@intel.com>
Committed: Fri Nov 27 14:49:52 2015 +0800

----------------------------------------------------------------------
 kerby-pkix/pom.xml                              |  36 +++++
 .../kerby/x500/type/AttributeTypeAndValue.java  |  63 ++++++++
 .../java/org/apache/kerby/x500/type/Name.java   |  49 ++++++
 .../org/apache/kerby/x500/type/RDNSequence.java |   9 ++
 .../x500/type/RelativeDistinguishedName.java    |  29 ++++
 .../kerby/x509/type/AccessDescription.java      |  66 ++++++++
 .../kerby/x509/type/AlgorithmIdentifier.java    |  59 +++++++
 .../apache/kerby/x509/type/AttCertIssuer.java   |  61 ++++++++
 .../kerby/x509/type/AttCertValidityPeriod.java  |  62 ++++++++
 .../org/apache/kerby/x509/type/Attribute.java   |  62 ++++++++
 .../kerby/x509/type/AttributeCertificate.java   |  73 +++++++++
 .../x509/type/AttributeCertificateInfo.java     | 145 +++++++++++++++++
 .../apache/kerby/x509/type/AttributeValues.java |  27 ++++
 .../org/apache/kerby/x509/type/Attributes.java  |  43 +++++
 .../x509/type/AuthorityInformationAccess.java   |  41 +++++
 .../kerby/x509/type/AuthorityKeyIdentifier.java |  80 ++++++++++
 .../kerby/x509/type/BasicConstraints.java       |  69 +++++++++
 .../apache/kerby/x509/type/CRLDistPoint.java    |  31 ++++
 .../org/apache/kerby/x509/type/CRLNumber.java   |  31 ++++
 .../org/apache/kerby/x509/type/CRLReason.java   |  66 ++++++++
 .../apache/kerby/x509/type/CertPolicyId.java    |  31 ++++
 .../org/apache/kerby/x509/type/Certificate.java |  73 +++++++++
 .../apache/kerby/x509/type/CertificateList.java |  75 +++++++++
 .../apache/kerby/x509/type/CertificatePair.java |  64 ++++++++
 .../kerby/x509/type/CertificatePolicies.java    |  32 ++++
 .../x509/type/CertificateSerialNumber.java      |  26 ++++
 .../apache/kerby/x509/type/DSAParameter.java    |  66 ++++++++
 .../org/apache/kerby/x509/type/DigestInfo.java  |  62 ++++++++
 .../kerby/x509/type/DigestedObjectType.java     |  53 +++++++
 .../apache/kerby/x509/type/DirectoryString.java | 100 ++++++++++++
 .../org/apache/kerby/x509/type/DisplayText.java |  87 +++++++++++
 .../kerby/x509/type/DistributionPoint.java      |  74 +++++++++
 .../kerby/x509/type/DistributionPointName.java  |  64 ++++++++
 .../apache/kerby/x509/type/EDIPartyName.java    |  62 ++++++++
 .../kerby/x509/type/ExtendedKeyUsage.java       |  31 ++++
 .../org/apache/kerby/x509/type/Extension.java   |  77 +++++++++
 .../org/apache/kerby/x509/type/Extensions.java  |  37 +++++
 .../org/apache/kerby/x509/type/GeneralName.java | 147 ++++++++++++++++++
 .../apache/kerby/x509/type/GeneralNames.java    |  26 ++++
 .../apache/kerby/x509/type/GeneralSubtree.java  |  77 +++++++++
 .../apache/kerby/x509/type/GeneralSubtrees.java |  25 +++
 .../java/org/apache/kerby/x509/type/Holder.java |  78 ++++++++++
 .../apache/kerby/x509/type/IetfAttrSyntax.java  |  69 +++++++++
 .../kerby/x509/type/IetfAttrSyntaxChoice.java   |  78 ++++++++++
 .../kerby/x509/type/IetfAttrSyntaxChoices.java  |  26 ++++
 .../apache/kerby/x509/type/IssuerSerial.java    |  73 +++++++++
 .../x509/type/IssuingDistributionPoint.java     | 107 +++++++++++++
 .../apache/kerby/x509/type/KeyIdentifier.java   |  32 ++++
 .../apache/kerby/x509/type/KeyPurposeId.java    |  36 +++++
 .../org/apache/kerby/x509/type/KeyUsage.java    |  62 ++++++++
 .../apache/kerby/x509/type/NameConstraints.java |  60 +++++++
 .../apache/kerby/x509/type/NoticeNumbers.java   |  31 ++++
 .../apache/kerby/x509/type/NoticeReference.java |  63 ++++++++
 .../kerby/x509/type/ObjectDigestInfo.java       |  93 +++++++++++
 .../org/apache/kerby/x509/type/OtherName.java   |  66 ++++++++
 .../kerby/x509/type/PolicyConstraints.java      |  67 ++++++++
 .../kerby/x509/type/PolicyInformation.java      |  61 ++++++++
 .../apache/kerby/x509/type/PolicyMapping.java   |  62 ++++++++
 .../apache/kerby/x509/type/PolicyMappings.java  |  34 ++++
 .../kerby/x509/type/PolicyQualifierId.java      |  46 ++++++
 .../kerby/x509/type/PolicyQualifierInfo.java    |  66 ++++++++
 .../kerby/x509/type/PolicyQualifierInfos.java   |  31 ++++
 .../kerby/x509/type/PrivateKeyUsagePeriod.java  |  63 ++++++++
 .../org/apache/kerby/x509/type/ReasonFlags.java |  61 ++++++++
 .../kerby/x509/type/RevokedCertificate.java     |  75 +++++++++
 .../kerby/x509/type/RevokedCertificates.java    |  38 +++++
 .../org/apache/kerby/x509/type/RoleSyntax.java  |  63 ++++++++
 .../x509/type/SubjectDirectoryAttributes.java   |  39 +++++
 .../kerby/x509/type/SubjectKeyIdentifier.java   |  32 ++++
 .../kerby/x509/type/SubjectPublicKeyInfo.java   |  60 +++++++
 .../org/apache/kerby/x509/type/TBSCertList.java | 128 +++++++++++++++
 .../apache/kerby/x509/type/TBSCertificate.java  | 155 +++++++++++++++++++
 .../java/org/apache/kerby/x509/type/Target.java |  74 +++++++++
 .../org/apache/kerby/x509/type/TargetCert.java  |  70 +++++++++
 .../kerby/x509/type/TargetInformation.java      |  34 ++++
 .../org/apache/kerby/x509/type/Targets.java     |  45 ++++++
 .../java/org/apache/kerby/x509/type/Time.java   |  66 ++++++++
 .../org/apache/kerby/x509/type/UserNotice.java  |  63 ++++++++
 .../java/org/apache/kerby/x509/type/V2Form.java |  77 +++++++++
 pom.xml                                         |   1 +
 80 files changed, 4776 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/pom.xml
----------------------------------------------------------------------
diff --git a/kerby-pkix/pom.xml b/kerby-pkix/pom.xml
new file mode 100644
index 0000000..77abf62
--- /dev/null
+++ b/kerby-pkix/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <parent>
+    <groupId>org.apache.kerby</groupId>
+    <artifactId>kerby-all</artifactId>
+    <version>1.0.0-RC2-SNAPSHOT</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>kerby-pkix</artifactId>
+  <name>Kerby PKIX Project</name>
+  <description>Kerby PKIX Project</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerby-asn1</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x500/type/AttributeTypeAndValue.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x500/type/AttributeTypeAndValue.java b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/AttributeTypeAndValue.java
new file mode 100644
index 0000000..21e314b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/AttributeTypeAndValue.java
@@ -0,0 +1,63 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x500.type;
+
+import org.apache.kerby.asn1.type.Asn1Any;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.Asn1Type;
+
+/**
+ * AttributeTypeAndValue ::= SEQUENCE {
+ *     type  OBJECT IDENTIFIER,
+ *     value ANY
+ * }
+ */
+public class AttributeTypeAndValue extends Asn1SequenceType {
+
+    private static final int TYPE = 0;
+    private static final int VALUE = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
+            new Asn1FieldInfo(TYPE, Asn1ObjectIdentifier.class, true),
+            new Asn1FieldInfo(VALUE, Asn1Any.class, true)
+    };
+
+    public AttributeTypeAndValue() {
+        super(fieldInfos);
+    }
+
+    public Asn1ObjectIdentifier getType() {
+        return getFieldAs(TYPE, Asn1ObjectIdentifier.class);
+    }
+
+    public void setType(Asn1ObjectIdentifier type) {
+        setFieldAs(TYPE, type);
+    }
+
+    public Asn1Type getAttributeValue() {
+        return getFieldAsAny(VALUE);
+    }
+
+    public void setAttributeValue(Asn1Type value) {
+        setFieldAsAny(VALUE, value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x500/type/Name.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x500/type/Name.java b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/Name.java
new file mode 100644
index 0000000..280082d
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/Name.java
@@ -0,0 +1,49 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x500.type;
+
+import org.apache.kerby.asn1.type.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+
+/**
+ *
+ * <pre>
+ *     Name ::= CHOICE { RDNSequence }
+ * </pre>
+ */
+public class Name extends Asn1Choice {
+    private static final int RDN_SEQUENCE = 0;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
+        new Asn1FieldInfo(RDN_SEQUENCE, RDNSequence.class),
+    };
+
+    public Name() {
+        super(fieldInfos);
+    }
+
+    public RDNSequence getName() {
+        return getFieldAs(RDN_SEQUENCE, RDNSequence.class);
+    }
+
+    public void setName(RDNSequence name) {
+        setFieldAs(RDN_SEQUENCE, name);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RDNSequence.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RDNSequence.java b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RDNSequence.java
new file mode 100644
index 0000000..f61e56b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RDNSequence.java
@@ -0,0 +1,9 @@
+package org.apache.kerby.x500.type;
+
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
+ */
+public class RDNSequence extends Asn1SequenceOf<RelativeDistinguishedName>{
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RelativeDistinguishedName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RelativeDistinguishedName.java b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RelativeDistinguishedName.java
new file mode 100644
index 0000000..7b2dceb
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x500/type/RelativeDistinguishedName.java
@@ -0,0 +1,29 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x500.type;
+
+import org.apache.kerby.asn1.type.Asn1SetOf;
+import org.apache.kerby.x500.type.AttributeTypeAndValue;
+
+/**
+ * RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
+ */
+public class RelativeDistinguishedName extends Asn1SetOf<AttributeTypeAndValue> {
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AccessDescription.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AccessDescription.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AccessDescription.java
new file mode 100644
index 0000000..1ef91fd
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AccessDescription.java
@@ -0,0 +1,66 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ *
+ * <pre>
+ * AccessDescription  ::=  SEQUENCE {
+ *       accessMethod          OBJECT IDENTIFIER,
+ *       accessLocation        GeneralName
+ *  }
+ * </pre>
+ */
+public class AccessDescription extends Asn1SequenceType {
+    public final static String id_ad_caIssuers = "1.3.6.1.5.5.7.48.2";
+    public final static String id_ad_ocsp = "1.3.6.1.5.5.7.48.1";
+
+    private static final int ACCESS_METHOD = 0;
+    private static final int ACCESS_LOCATION = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(ACCESS_METHOD, Asn1ObjectIdentifier.class),
+        new Asn1FieldInfo(ACCESS_LOCATION, GeneralName.class)
+    };
+
+    public AccessDescription() {
+        super(fieldInfos);
+    }
+
+    public Asn1ObjectIdentifier getAccessMethod() {
+        return getFieldAs(ACCESS_METHOD, Asn1ObjectIdentifier.class);
+    }
+
+    public void setAccessMethod(Asn1ObjectIdentifier accessMethod) {
+        setFieldAs(ACCESS_METHOD, accessMethod);
+    }
+
+    public GeneralName getAccessLocation() {
+        return getFieldAs(ACCESS_LOCATION, GeneralName.class);
+    }
+
+    public void setAccessLocation(GeneralName accessLocation) {
+        setFieldAs(ACCESS_LOCATION, accessLocation);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
new file mode 100644
index 0000000..3ce7736
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
@@ -0,0 +1,59 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.kerby.x509.type;
+
+
+import org.apache.kerby.asn1.type.*;
+
+/**
+ * AlgorithmIdentifier  ::=  SEQUENCE  {
+ *    algorithm               OBJECT IDENTIFIER,
+ *    parameters              ANY DEFINED BY algorithm OPTIONAL
+ * }
+ */
+public class AlgorithmIdentifier extends Asn1SequenceType {
+    private static final int ALGORITHM = 0;
+    private static final int PARAMETERS = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(ALGORITHM, Asn1ObjectIdentifier.class),
+            new Asn1FieldInfo(PARAMETERS, Asn1Any.class)
+    };
+
+    public AlgorithmIdentifier() {
+        super(fieldInfos);
+    }
+
+    public Asn1ObjectIdentifier getAlgorithm() {
+        return getFieldAs(ALGORITHM, Asn1ObjectIdentifier.class);
+    }
+
+    public void setAlgorithm(Asn1ObjectIdentifier algorithm) {
+        setFieldAs(ALGORITHM, algorithm);
+    }
+
+    public Asn1Type getParameters() {
+        return getFieldAsAny(PARAMETERS);
+    }
+
+    public void setParameters(Asn1Type parameters) {
+        setFieldAsAny(PARAMETERS, parameters);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertIssuer.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertIssuer.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertIssuer.java
new file mode 100644
index 0000000..0fbef5c
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertIssuer.java
@@ -0,0 +1,61 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.*;
+
+/**
+ *
+ * <pre>
+ *  AttCertIssuer ::= CHOICE {
+ *       v1Form   GeneralNames,  -- MUST NOT be used in this profile
+ *       v2Form   [0] V2Form     -- v2 only
+ *  }
+ * </pre>
+ */
+public class AttCertIssuer extends Asn1Choice {
+    private static final int V1_FORM = 0;
+    private static final int V2_FORM = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(V1_FORM, GeneralNames.class),
+        new ExplicitField(V2_FORM, 0, V2Form.class)
+    };
+
+    public AttCertIssuer() {
+        super(fieldInfos);
+    }
+
+    public GeneralNames getV1Form() {
+        return getFieldAs(V1_FORM, GeneralNames.class);
+    }
+
+    public void setV1Form(GeneralNames v1Form) {
+        setFieldAs(V1_FORM, v1Form);
+    }
+
+    public V2Form getV2Form() {
+        return getFieldAs(V2_FORM, V2Form.class);
+    }
+
+    public void setV2Form(V2Form v2Form) {
+        setFieldAs(V2_FORM, v2Form);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertValidityPeriod.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertValidityPeriod.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertValidityPeriod.java
new file mode 100644
index 0000000..20b2b9e
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttCertValidityPeriod.java
@@ -0,0 +1,62 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1GeneralizedTime;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ *  AttCertValidityPeriod  ::= SEQUENCE {
+ *       notBeforeTime  GeneralizedTime,
+ *       notAfterTime   GeneralizedTime
+ *  }
+ * </pre>
+ */
+public class AttCertValidityPeriod extends Asn1SequenceType {
+    private static final int NOT_BEFORE = 0;
+    private static final int NOT_AFTER = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(NOT_BEFORE, Asn1GeneralizedTime.class),
+        new Asn1FieldInfo(NOT_AFTER, Asn1GeneralizedTime.class)
+    };
+
+    public AttCertValidityPeriod() {
+        super(fieldInfos);
+    }
+
+    public Asn1GeneralizedTime getNotBeforeTime() {
+        return getFieldAs(NOT_BEFORE, Asn1GeneralizedTime.class);
+    }
+
+    public void setNotBeforeTime(Asn1GeneralizedTime notBeforeTime) {
+        setFieldAs(NOT_BEFORE, notBeforeTime);
+    }
+
+    public Asn1GeneralizedTime getNotAfterTime() {
+        return getFieldAs(NOT_AFTER, Asn1GeneralizedTime.class);
+    }
+
+    public void setNotAfterTime(Asn1GeneralizedTime notAfterTime) {
+        setFieldAs(NOT_AFTER, notAfterTime);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attribute.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attribute.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attribute.java
new file mode 100644
index 0000000..36fb541
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attribute.java
@@ -0,0 +1,62 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ * Attribute ::= SEQUENCE {
+ *     attrType OBJECT IDENTIFIER,
+ *     attrValues SET OF AttributeValue
+ * }
+ * </pre>
+ */
+public class Attribute extends Asn1SequenceType {
+    private static final int ATTR_TYPE = 0;
+    private static final int ATTR_VALUES = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(ATTR_TYPE, Asn1ObjectIdentifier.class),
+        new Asn1FieldInfo(ATTR_VALUES, AttributeValues.class)
+    };
+
+    public Attribute() {
+        super(fieldInfos);
+    }
+
+    public Asn1ObjectIdentifier getAttrType() {
+        return getFieldAs(ATTR_TYPE, Asn1ObjectIdentifier.class);
+    }
+
+    public void setAttrType(Asn1ObjectIdentifier attrType) {
+        setFieldAs(ATTR_TYPE, attrType);
+    }
+
+    public AttributeValues getAttrValues() {
+        return getFieldAs(ATTR_VALUES, AttributeValues.class);
+    }
+
+    public void setAttrValues(AttributeValues attrValues) {
+        setFieldAs(ATTR_VALUES, attrValues);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificate.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificate.java
new file mode 100644
index 0000000..db7b342
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificate.java
@@ -0,0 +1,73 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BitString;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ *  AttributeCertificate ::= SEQUENCE {
+ *       acinfo               AttributeCertificateInfo,
+ *       signatureAlgorithm   AlgorithmIdentifier,
+ *       signatureValue       BIT STRING
+ *  }
+ * </pre>
+ */
+public class AttributeCertificate extends Asn1SequenceType {
+    private static final int ACI_INFO = 0;
+    private static final int SIGNATURE_ALGORITHM = 1;
+    private static final int SIGNATURE_VALUE = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(ACI_INFO, AttributeCertificateInfo.class),
+        new Asn1FieldInfo(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(SIGNATURE_VALUE, Asn1BitString.class)
+    };
+
+    public AttributeCertificate() {
+        super(fieldInfos);
+    }
+
+    public AttributeCertificateInfo getAcinfo() {
+        return getFieldAs(ACI_INFO, AttributeCertificateInfo.class);
+    }
+
+    public void setAciInfo(AttributeCertificateInfo aciInfo) {
+        setFieldAs(ACI_INFO, aciInfo);
+    }
+
+    public AlgorithmIdentifier getSignatureAlgorithm() {
+        return getFieldAs(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class);
+    }
+
+    public void setSignatureAlgorithm(AlgorithmIdentifier signatureAlgorithm) {
+        setFieldAs(SIGNATURE_ALGORITHM, signatureAlgorithm);
+    }
+
+    public Asn1BitString getSignatureValue() {
+        return getFieldAs(SIGNATURE_VALUE, Asn1BitString.class);
+    }
+
+    public void setSignatureValue(Asn1BitString signatureValue) {
+        setFieldAs(SIGNATURE_VALUE, signatureValue);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificateInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificateInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificateInfo.java
new file mode 100644
index 0000000..a3c1a62
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeCertificateInfo.java
@@ -0,0 +1,145 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BitString;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ *
+ * <pre>
+ *  AttributeCertificateInfo ::= SEQUENCE {
+ *       version              AttCertVersion -- version is v2,
+ *       holder               Holder,
+ *       issuer               AttCertIssuer,
+ *       signature            AlgorithmIdentifier,
+ *       serialNumber         CertificateSerialNumber,
+ *       attrCertValidityPeriod   AttCertValidityPeriod,
+ *       attributes           SEQUENCE OF Attribute,
+ *       issuerUniqueID       UniqueIdentifier OPTIONAL,
+ *       extensions           Extensions OPTIONAL
+ *  }
+ *
+ *  AttCertVersion ::= INTEGER { v2(1) }
+ *
+ *  UniqueIdentifier  ::=  BIT STRING
+ * </pre>
+ */
+public class AttributeCertificateInfo extends Asn1SequenceType {
+    private static final int VERSION = 0;
+    private static final int HOLDER = 1;
+    private static final int ISSUER = 2;
+    private static final int SIGNATURE = 3;
+    private static final int SERIAL_NUMBER = 4;
+    private static final int ATTR_CERT_VALIDITY_PERIOD = 5;
+    private static final int ATTRIBUTES = 6;
+    private static final int ISSUER_UNIQUE_ID = 7;
+    private static final int EXTENSIONS = 8;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(VERSION, Asn1Integer.class),
+        new Asn1FieldInfo(HOLDER, Holder.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)
+    };
+
+    public AttributeCertificateInfo() {
+        super(fieldInfos);
+    }
+
+    public int getVersion() {
+        return getFieldAsInteger(VERSION);
+    }
+
+    public void setVersion(int version) {
+        setFieldAsInt(VERSION, version);
+    }
+
+    public Holder getHolder() {
+        return getFieldAs(HOLDER, Holder.class);
+    }
+
+    public void setHolder(Holder holder) {
+        setFieldAs(HOLDER, holder);
+    }
+
+    public AttCertIssuer getIssuer() {
+        return getFieldAs(ISSUER, AttCertIssuer.class);
+    }
+
+    public void setIssuer(AttCertIssuer attCertIssuer) {
+        setFieldAs(ISSUER, attCertIssuer);
+    }
+
+    public AlgorithmIdentifier getSignature() {
+        return getFieldAs(SIGNATURE, AlgorithmIdentifier.class);
+    }
+
+    public void setSignature(AlgorithmIdentifier signature) {
+        setFieldAs(SIGNATURE, signature);
+    }
+
+    public CertificateSerialNumber getSerialNumber() {
+        return getFieldAs(SERIAL_NUMBER, CertificateSerialNumber.class);
+    }
+
+    public void setSerialNumber(CertificateSerialNumber certificateSerialNumber) {
+        setFieldAs(SERIAL_NUMBER, certificateSerialNumber);
+    }
+
+    public AttCertValidityPeriod getAttrCertValidityPeriod() {
+        return getFieldAs(ATTR_CERT_VALIDITY_PERIOD, AttCertValidityPeriod.class);
+    }
+
+    public void setAttrCertValidityPeriod(AttCertValidityPeriod attrCertValidityPeriod) {
+        setFieldAs(ATTR_CERT_VALIDITY_PERIOD, attrCertValidityPeriod);
+    }
+
+    public Attributes getAttributes() {
+        return getFieldAs(ATTRIBUTES, Attributes.class);
+    }
+
+    public void setAttributes(Attributes attributes) {
+        setFieldAs(ATTRIBUTES, attributes);
+    }
+
+    public byte[] getIssuerUniqueID() {
+        return getFieldAs(ISSUER_UNIQUE_ID, Asn1BitString.class).getValue();
+    }
+
+    public void setIssuerUniqueId(byte[] issuerUniqueId) {
+        setFieldAs(ISSUER_UNIQUE_ID, new Asn1BitString(issuerUniqueId));
+    }
+
+    public Extensions getExtensions() {
+        return getFieldAs(EXTENSIONS, Extensions.class);
+    }
+
+    public void setExtensions(Extensions extensions) {
+        setFieldAs(EXTENSIONS, extensions);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeValues.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeValues.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeValues.java
new file mode 100644
index 0000000..f407856
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AttributeValues.java
@@ -0,0 +1,27 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1SetOf;
+import org.apache.kerby.asn1.type.Asn1Type;
+
+public class AttributeValues extends Asn1SetOf<Asn1Type> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attributes.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attributes.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attributes.java
new file mode 100644
index 0000000..c63b7fc
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Attributes.java
@@ -0,0 +1,43 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ * Ref. RFC 3039
+ *
+ * <pre>
+ *     SubjectDirectoryAttributes ::= Attributes
+ *     Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+ *     Attribute ::= SEQUENCE {
+ *       type AttributeType
+ *       values SET OF AttributeValue
+ *     }
+ *
+ *     AttributeType ::= OBJECT IDENTIFIER
+ *     AttributeValue ::= ANY DEFINED BY AttributeType
+ * </pre>
+ *
+ * @see org.bouncycastle.asn1.x500.style.BCStyle for AttributeType ObjectIdentifiers.
+ */
+public class Attributes extends Asn1SequenceOf<Attribute> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityInformationAccess.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityInformationAccess.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityInformationAccess.java
new file mode 100644
index 0000000..1719304
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityInformationAccess.java
@@ -0,0 +1,41 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ *
+ * <pre>
+ * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
+ *
+ * AuthorityInfoAccessSyntax  ::=
+ *      SEQUENCE SIZE (1..MAX) OF AccessDescription
+ * AccessDescription  ::=  SEQUENCE {
+ *       accessMethod          OBJECT IDENTIFIER,
+ *       accessLocation        GeneralName
+ * }
+ *
+ * </pre>
+ */
+public class AuthorityInformationAccess
+    extends Asn1SequenceOf<AccessDescription> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityKeyIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityKeyIdentifier.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityKeyIdentifier.java
new file mode 100644
index 0000000..e289fc8
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AuthorityKeyIdentifier.java
@@ -0,0 +1,80 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ImplicitField;
+
+/**
+ *
+ * <pre>
+ * id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
+ *
+ *   AuthorityKeyIdentifier ::= SEQUENCE {
+ *        keyIdentifier             [0] IMPLICIT KeyIdentifier           OPTIONAL,
+ *        authorityCertIssuer       [1] IMPLICIT GeneralNames            OPTIONAL,
+ *        authorityCertSerialNumber [2] IMPLICIT CertificateSerialNumber OPTIONAL
+ *      }
+ *
+ *   KeyIdentifier ::= OCTET STRING
+ * </pre>
+ *
+ */
+public class AuthorityKeyIdentifier extends Asn1SequenceType {
+    private static final int KEY_IDENTIFIER = 0;
+    private static final int AUTHORITY_CERT_ISSUER = 1;
+    private static final int AUTHORITY_CERT_SERIAL_NUMBER = 2;
+
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new ImplicitField(KEY_IDENTIFIER, KeyIdentifier.class),
+        new ImplicitField(AUTHORITY_CERT_ISSUER, GeneralNames.class),
+        new ImplicitField(AUTHORITY_CERT_SERIAL_NUMBER, CertificateSerialNumber.class)
+    };
+
+    public AuthorityKeyIdentifier() {
+        super(fieldInfos);
+    }
+
+    public KeyIdentifier getKeyIdentifier() {
+        return getFieldAs(KEY_IDENTIFIER, KeyIdentifier.class);
+    }
+
+    public void setKeyIdentifier(KeyIdentifier keyIdentifier) {
+        setFieldAs(KEY_IDENTIFIER, keyIdentifier);
+    }
+
+    public GeneralNames getAuthorityCertIssuer() {
+        return getFieldAs(AUTHORITY_CERT_ISSUER, GeneralNames.class);
+    }
+
+    public void setAuthorityCertIssuer(GeneralNames authorityCertIssuer) {
+        setFieldAs(AUTHORITY_CERT_ISSUER, authorityCertIssuer);
+    }
+    
+    public CertificateSerialNumber getAuthorityCertSerialNumber() {
+        return getFieldAs(AUTHORITY_CERT_SERIAL_NUMBER, CertificateSerialNumber.class);
+    }
+
+    public void setAuthorityCertSerialNumber(CertificateSerialNumber authorityCertSerialNumber) {
+        setFieldAs(AUTHORITY_CERT_SERIAL_NUMBER, authorityCertSerialNumber);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/BasicConstraints.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/BasicConstraints.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/BasicConstraints.java
new file mode 100644
index 0000000..d4b0ad0
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/BasicConstraints.java
@@ -0,0 +1,69 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1Boolean;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+import java.math.BigInteger;
+
+/**
+ * <pre>
+ * BasicConstraints := SEQUENCE {
+ *    cA                  BOOLEAN DEFAULT FALSE,
+ *    pathLenConstraint   INTEGER (0..MAX) OPTIONAL
+ * }
+ * </pre>
+ */
+public class BasicConstraints extends Asn1SequenceType {
+    private static final int CA = 0;
+    private static final int PATH_LEN_CONSTRAINT = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(CA, Asn1Boolean.class),
+        new Asn1FieldInfo(PATH_LEN_CONSTRAINT, Asn1Integer.class)
+    };
+
+    public BasicConstraints() {
+        super(fieldInfos);
+    }
+
+    public boolean isCA() {
+        return false;
+    }
+
+    public boolean getCA() {
+        return getFieldAs(CA, Asn1Boolean.class).getValue();
+    }
+
+    public void setCA(Asn1Boolean isCA) {
+        setFieldAs(CA, isCA);
+    }
+
+    public BigInteger getPathLenConstraint() {
+        return getFieldAs(PATH_LEN_CONSTRAINT, Asn1Integer.class).getValue();
+    }
+
+    public void setPathLenConstraint(Asn1Integer pathLenConstraint) {
+        setFieldAs(PATH_LEN_CONSTRAINT, pathLenConstraint);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLDistPoint.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLDistPoint.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLDistPoint.java
new file mode 100644
index 0000000..d926404
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLDistPoint.java
@@ -0,0 +1,31 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ * <pre>
+ * CRLDistPoint ::= SEQUENCE SIZE {1..MAX} OF DistributionPoint
+ * </pre>
+ */
+public class CRLDistPoint extends Asn1SequenceOf<DistributionPoint> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLNumber.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLNumber.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLNumber.java
new file mode 100644
index 0000000..745679b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLNumber.java
@@ -0,0 +1,31 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1Integer;
+
+/**
+ * <pre>
+ * CRLNumber::= INTEGER(0..MAX)
+ * </pre>
+ */
+public class CRLNumber extends Asn1Integer {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLReason.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLReason.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLReason.java
new file mode 100644
index 0000000..1596b8a
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CRLReason.java
@@ -0,0 +1,66 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1EnumType;
+import org.apache.kerby.asn1.type.Asn1Enumerated;
+
+/**
+ *
+ * <pre>
+ * CRLReason ::= ENUMERATED {
+ *  unspecified             (0),
+ *  keyCompromise           (1),
+ *  cACompromise            (2),
+ *  affiliationChanged      (3),
+ *  superseded              (4),
+ *  cessationOfOperation    (5),
+ *  certificateHold         (6),
+ *  removeFromCRL           (8),
+ *  privilegeWithdrawn      (9),
+ *  aACompromise           (10)
+ * }
+ * </pre>
+ */
+
+enum CRLReasonEnum implements Asn1EnumType {
+    UNSPECIFIED,
+    KEY_COMPROMISE,
+    CA_COMPROMISE,
+    AFFILIATION_CHANGED,
+    SUPERSEDED,
+    CESSATION_OF_OPERATION,
+    CERTIFICATE_HOLD,
+    REMOVE_FROM_CRL,
+    PRIVILEGE_WITH_DRAWN,
+    AA_COMPROMISE;
+
+    @Override
+    public int getValue() {
+        return ordinal();
+    }
+}
+
+public class CRLReason extends Asn1Enumerated<CRLReasonEnum> {
+    @Override
+    public Asn1EnumType[] getAllEnumValues() {
+        return CRLReasonEnum.values();
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertPolicyId.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertPolicyId.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertPolicyId.java
new file mode 100644
index 0000000..dc97c32
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertPolicyId.java
@@ -0,0 +1,31 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
+
+/**
+ * <pre>
+ *     CertPolicyId ::= OBJECT IDENTIFIER
+ * </pre>
+ */
+public class CertPolicyId extends Asn1ObjectIdentifier {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Certificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Certificate.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Certificate.java
new file mode 100644
index 0000000..53dc285
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Certificate.java
@@ -0,0 +1,73 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BitString;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ *  Certificate ::= SEQUENCE {
+ *      tbsCertificate          TBSCertificate,
+ *      signatureAlgorithm      AlgorithmIdentifier,
+ *      signature               BIT STRING
+ *  }
+ * </pre>
+ */
+public class Certificate extends Asn1SequenceType {
+    private static final int TBS_CERTIFICATE = 0;
+    private static final int SIGNATURE_ALGORITHM = 1;
+    private static final int SIGNATURE = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(TBS_CERTIFICATE, TBSCertificate.class),
+        new Asn1FieldInfo(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(SIGNATURE, Asn1BitString.class)
+    };
+
+    public Certificate() {
+        super(fieldInfos);
+    }
+
+    public TBSCertificate getTBSCertificate() {
+        return getFieldAs(TBS_CERTIFICATE, TBSCertificate.class);
+    }
+
+    public void setTbsCertificate(TBSCertificate tbsCertificate) {
+        setFieldAs(TBS_CERTIFICATE, tbsCertificate);
+    }
+
+    public AlgorithmIdentifier getSignatureAlgorithm() {
+        return getFieldAs(SIGNATURE_ALGORITHM, AlgorithmIdentifier.class);
+    }
+
+    public void setSignatureAlgorithm(AlgorithmIdentifier signatureAlgorithm) {
+        setFieldAs(SIGNATURE_ALGORITHM, signatureAlgorithm);
+    }
+
+    public Asn1BitString getSignature() {
+        return getFieldAs(SIGNATURE, Asn1BitString.class);
+    }
+
+    public void setSignature(Asn1BitString signature) {
+        setFieldAs(SIGNATURE, signature);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateList.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateList.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateList.java
new file mode 100644
index 0000000..b9ea948
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateList.java
@@ -0,0 +1,75 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BitString;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ *
+ * RFC-2459:
+ * <pre>
+ * CertificateList  ::=  SEQUENCE  {
+ *      tbsCertList          TBSCertList,
+ *      signatureAlgorithm   AlgorithmIdentifier,
+ *      signatureValue       BIT STRING
+ * }
+ * </pre>
+ */
+public class CertificateList extends Asn1SequenceType {
+    private static final int TBS_CERT_LIST = 0;
+    private static final int SIGNATURE_ALGORITHMS = 1;
+    private static final int SIGNATURE_VALUE = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(TBS_CERT_LIST, TBSCertList.class),
+        new Asn1FieldInfo(SIGNATURE_ALGORITHMS, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(SIGNATURE_VALUE, Asn1BitString.class)
+    };
+
+    public CertificateList() {
+        super(fieldInfos);
+    }
+
+    public TBSCertList getTBSCertList() {
+        return getFieldAs(TBS_CERT_LIST, TBSCertList.class);
+    }
+
+    public void setTBSCertList(TBSCertList tbsCertList) {
+        setFieldAs(TBS_CERT_LIST, tbsCertList);
+    }
+
+    public AlgorithmIdentifier getSignatureAlgorithm() {
+        return getFieldAs(SIGNATURE_ALGORITHMS, AlgorithmIdentifier.class);
+    }
+
+    public void setSignatureAlgorithms(AlgorithmIdentifier signatureAlgorithms) {
+        setFieldAs(SIGNATURE_ALGORITHMS, signatureAlgorithms);
+    }
+
+    public Asn1BitString getSignature() {
+        return getFieldAs(SIGNATURE_VALUE, Asn1BitString.class);
+    }
+
+    public void setSignatureValue(Asn1BitString signatureValue) {
+        setFieldAs(SIGNATURE_VALUE, signatureValue);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePair.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePair.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePair.java
new file mode 100644
index 0000000..9a9c0db
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePair.java
@@ -0,0 +1,64 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ *
+ * <pre>
+ *       CertificatePair ::= SEQUENCE {
+ *         forward        [0]    Certificate OPTIONAL,
+ *         reverse        [1]    Certificate OPTIONAL,
+ *             -- at least one of the pair shall be present --
+ *       }
+ * </pre>
+ */
+public class CertificatePair extends Asn1SequenceType {
+    private static final int FORWARD = 0;
+    private static final int REVERSE = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new ExplicitField(FORWARD, Certificate.class),
+        new ExplicitField(REVERSE, Certificate.class)
+    };
+
+    public CertificatePair() {
+        super(fieldInfos);
+    }
+
+    public Certificate getForward() {
+        return getFieldAs(FORWARD, Certificate.class);
+    }
+
+    public void setForward(Certificate forward) {
+        setFieldAs(FORWARD, forward);
+    }
+
+    public Certificate getReverse() {
+        return getFieldAs(REVERSE, Certificate.class);
+    }
+
+    public void setReverse(Certificate reverse) {
+        setFieldAs(REVERSE, reverse);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePolicies.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePolicies.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePolicies.java
new file mode 100644
index 0000000..92663c5
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificatePolicies.java
@@ -0,0 +1,32 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ *
+ * <pre>
+ * CertificatePolicies ::= SEQUENCE SIZE {1..MAX} OF PolicyInformation
+ * </pre>
+ */
+public class CertificatePolicies extends Asn1SequenceOf<PolicyInformation> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateSerialNumber.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateSerialNumber.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateSerialNumber.java
new file mode 100644
index 0000000..a2f06f3
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/CertificateSerialNumber.java
@@ -0,0 +1,26 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1Integer;
+
+public class CertificateSerialNumber extends Asn1Integer {
+}
+

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DSAParameter.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DSAParameter.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DSAParameter.java
new file mode 100644
index 0000000..3183d9f
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DSAParameter.java
@@ -0,0 +1,66 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+import java.math.BigInteger;
+
+public class DSAParameter extends Asn1SequenceType {
+    private static final int P = 0;
+    private static final int Q = 1;
+    private static final int G = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(P, Asn1Integer.class),
+        new Asn1FieldInfo(Q, Asn1Integer.class),
+        new Asn1FieldInfo(G, Asn1Integer.class)
+    };
+
+    public DSAParameter() {
+        super(fieldInfos);
+    }
+
+    public BigInteger getP() {
+        return getFieldAs(P, Asn1Integer.class).getValue();
+    }
+
+    public void setP(BigInteger p) {
+        setFieldAs(P, new Asn1Integer(p));
+    }
+
+    public BigInteger getQ() {
+        return getFieldAs(Q, Asn1Integer.class).getValue();
+    }
+
+    public void setQ(BigInteger q) {
+        setFieldAs(Q, new Asn1Integer(q));
+    }
+
+    public BigInteger getG() {
+        return getFieldAs(G, Asn1Integer.class).getValue();
+    }
+
+    public void setG(BigInteger g) {
+        setFieldAs(G, new Asn1Integer(g));
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestInfo.java
new file mode 100644
index 0000000..1f0ddec
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestInfo.java
@@ -0,0 +1,62 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ * DigestInfo::=SEQUENCE{
+ *          digestAlgorithm  AlgorithmIdentifier,
+ *          digest OCTET STRING
+ * }
+ * </pre>
+ */
+public class DigestInfo extends Asn1SequenceType {
+    private static final int DIGEST_ALGORITHM = 0;
+    private static final int DIGEST = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new Asn1FieldInfo(DIGEST_ALGORITHM, AlgorithmIdentifier.class),
+        new Asn1FieldInfo(DIGEST, Asn1OctetString.class)
+    };
+
+    public DigestInfo() {
+        super(fieldInfos);
+    }
+
+    public AlgorithmIdentifier getAlgorithmId() {
+        return getFieldAs(DIGEST_ALGORITHM, AlgorithmIdentifier.class);
+    }
+
+    public void setDigestAlgorithm(AlgorithmIdentifier digestAlgorithm) {
+        setFieldAs(DIGEST_ALGORITHM, digestAlgorithm);
+    }
+
+    public byte[] getDigest() {
+        return getFieldAsOctets(DIGEST);
+    }
+
+    public void setDigest(byte[] digest) {
+        setFieldAsOctets(DIGEST, digest);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestedObjectType.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestedObjectType.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestedObjectType.java
new file mode 100644
index 0000000..e67c503
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DigestedObjectType.java
@@ -0,0 +1,53 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1EnumType;
+import org.apache.kerby.asn1.type.Asn1Enumerated;
+
+/**
+ *
+ * <pre>
+ *         digestedObjectType  ENUMERATED {
+ *                 publicKey            (0),
+ *                 publicKeyCert        (1),
+ *                 otherObjectTypes     (2)
+ *         }
+ *   
+ * </pre>
+ * 
+ */
+enum DigestedObjectEnum implements Asn1EnumType {
+    PUBLIC_KEY,
+    PUBLIC_KEY_CERT,
+    OTHER_OBJECT_TYPES;
+
+    @Override
+    public int getValue() {
+        return ordinal();
+    }
+}
+
+public class DigestedObjectType extends Asn1Enumerated<DigestedObjectEnum> {
+    @Override
+    public Asn1EnumType[] getAllEnumValues() {
+        return DigestedObjectEnum.values();
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DirectoryString.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DirectoryString.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DirectoryString.java
new file mode 100644
index 0000000..7a623ff
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DirectoryString.java
@@ -0,0 +1,100 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BmpString;
+import org.apache.kerby.asn1.type.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1PrintableString;
+import org.apache.kerby.asn1.type.Asn1T61String;
+import org.apache.kerby.asn1.type.Asn1UniversalString;
+import org.apache.kerby.asn1.type.Asn1Utf8String;
+
+/**
+ * <pre>
+ *  DirectoryString ::= CHOICE {
+ *    teletexString               TeletexString (SIZE (1..MAX)),
+ *    printableString             PrintableString (SIZE (1..MAX)),
+ *    universalString             UniversalString (SIZE (1..MAX)),
+ *    utf8String                  UTF8String (SIZE (1..MAX)),
+ *    bmpString                   BMPString (SIZE (1..MAX))
+ * }
+ * </pre>
+ */
+public class DirectoryString extends Asn1Choice{
+
+    private static final int TELETEX_STRING = 0;
+    private static final int PRINTABLE_STRING = 1;
+    private static final int UNIVERSAL_STRING = 2;
+    private static final int UTF8_STRING = 3;
+    private static final int BMP_STRING = 4;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
+            new Asn1FieldInfo(TELETEX_STRING, Asn1T61String.class),
+            new Asn1FieldInfo(PRINTABLE_STRING, Asn1PrintableString.class),
+            new Asn1FieldInfo(UNIVERSAL_STRING, Asn1UniversalString.class),
+            new Asn1FieldInfo(UTF8_STRING, Asn1Utf8String.class),
+            new Asn1FieldInfo(BMP_STRING, Asn1BmpString.class)
+    };
+
+    public DirectoryString() {
+        super(fieldInfos);
+    }
+
+    public Asn1T61String getTeletexString() {
+        return getFieldAs(TELETEX_STRING, Asn1T61String.class);
+    }
+
+    public void setTeletexString(Asn1T61String teletexString) {
+        setFieldAs(TELETEX_STRING, teletexString);
+    }
+
+    public Asn1PrintableString getPrintableString() {
+        return getFieldAs(PRINTABLE_STRING, Asn1PrintableString.class);
+    }
+
+    public void setPrintableString(Asn1PrintableString printableString) {
+        setFieldAs(PRINTABLE_STRING, printableString);
+    }
+
+    public Asn1UniversalString getUniversalString() {
+        return getFieldAs(UNIVERSAL_STRING, Asn1UniversalString.class);
+    }
+
+    public void setUniversalString(Asn1UniversalString universalString) {
+        setFieldAs(UNIVERSAL_STRING, universalString);
+    }
+
+    public Asn1Utf8String getUtf8String() {
+        return getFieldAs(UTF8_STRING, Asn1Utf8String.class);
+    }
+
+    public void setUtf8String(Asn1Utf8String utf8String) {
+        setFieldAs(UTF8_STRING, utf8String);
+    }
+
+    public Asn1BmpString getBmpString() {
+        return getFieldAs(BMP_STRING, Asn1BmpString.class);
+    }
+
+    public void setBmpString(Asn1BmpString bmpString) {
+        setFieldAs(BMP_STRING, bmpString);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DisplayText.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DisplayText.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DisplayText.java
new file mode 100644
index 0000000..bb99ead
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DisplayText.java
@@ -0,0 +1,87 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1BmpString;
+import org.apache.kerby.asn1.type.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1IA5String;
+import org.apache.kerby.asn1.type.Asn1Utf8String;
+import org.apache.kerby.asn1.type.Asn1VisibleString;
+
+/**
+ * <pre>
+ * DisplayText ::= CHOICE {
+ *      ia5String        IA5String      (SIZE (1..200)),
+ *      visibleString    VisibleString  (SIZE (1..200)),
+ *      bmpString        BMPString      (SIZE (1..200)),
+ *      utf8String       UTF8String     (SIZE (1..200))
+ *  }
+ * </pre>
+ */
+public class DisplayText extends Asn1Choice {
+   private static final int IA5_STRING = 0;
+   private static final int VISIBLE_STRING = 1;
+   private static final int BMP_STRING = 2;
+   private static final int UTF8_STRING = 3;
+
+   static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
+           new Asn1FieldInfo(IA5_STRING, Asn1IA5String.class),
+           new Asn1FieldInfo(VISIBLE_STRING, Asn1VisibleString.class),
+           new Asn1FieldInfo(BMP_STRING, Asn1BmpString.class),
+           new Asn1FieldInfo(UTF8_STRING, Asn1BmpString.class)
+   };
+
+   public DisplayText() {
+      super(fieldInfos);
+   }
+
+   public Asn1IA5String getIA5String() {
+      return getFieldAs(IA5_STRING, Asn1IA5String.class);
+   }
+
+   public void setIA5String(Asn1IA5String ia5String) {
+      setFieldAs(IA5_STRING, ia5String);
+   }
+
+   public Asn1VisibleString getVisibleString() {
+      return getFieldAs(VISIBLE_STRING, Asn1VisibleString.class);
+   }
+
+   public void setVisibleString(Asn1VisibleString visibleString) {
+      setFieldAs(VISIBLE_STRING, visibleString);
+   }
+
+   public Asn1BmpString getBmpString() {
+      return getFieldAs(BMP_STRING, Asn1BmpString.class);
+   }
+
+   public void setBmpString(Asn1BmpString bmpString) {
+      setFieldAs(BMP_STRING, bmpString);
+   }
+
+   public Asn1Utf8String getUtf8String() {
+      return getFieldAs(UTF8_STRING, Asn1Utf8String.class);
+   }
+
+   public void setUtf8String(Asn1Utf8String utf8String) {
+      setFieldAs(UTF8_STRING, utf8String);
+   }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPoint.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPoint.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPoint.java
new file mode 100644
index 0000000..7a70f65
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPoint.java
@@ -0,0 +1,74 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ *
+ * <pre>
+ * DistributionPoint ::= SEQUENCE {
+ *      distributionPoint [0] DistributionPointName OPTIONAL,
+ *      reasons           [1] ReasonFlags OPTIONAL,
+ *      cRLIssuer         [2] GeneralNames OPTIONAL
+ * }
+ * </pre>
+ */
+public class DistributionPoint extends Asn1SequenceType {
+    private static final int DISTRIBUTION_POINT = 0;
+    private static final int REASONS = 1;
+    private static final int CRL_ISSUER = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new ExplicitField(DISTRIBUTION_POINT, DistributionPointName.class),
+        new ExplicitField(REASONS, ReasonFlags.class),
+        new ExplicitField(CRL_ISSUER, GeneralNames.class)
+    };
+
+    public DistributionPoint() {
+        super(fieldInfos);
+    }
+
+    public DistributionPointName getDistributionPoint() {
+        return getFieldAs(DISTRIBUTION_POINT, DistributionPointName.class);
+    }
+
+    public void setDistributionPoint(DistributionPointName distributionPoint) {
+        setFieldAs(DISTRIBUTION_POINT, distributionPoint);
+    }
+
+    public ReasonFlags getReasons() {
+        return getFieldAs(REASONS, ReasonFlags.class);
+    }
+
+    public void setReasons(ReasonFlags reasons) {
+        setFieldAs(REASONS, reasons);
+    }
+
+    public GeneralNames getCRLIssuer() {
+        return getFieldAs(CRL_ISSUER, GeneralNames.class);
+    }
+
+    public void setCRLIssuer(GeneralNames crlIssuer) {
+        setFieldAs(CRL_ISSUER, crlIssuer);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPointName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPointName.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPointName.java
new file mode 100644
index 0000000..0dc0579
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DistributionPointName.java
@@ -0,0 +1,64 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.ExplicitField;
+import org.apache.kerby.x500.type.RelativeDistinguishedName;
+
+/**
+ *
+ * <pre>
+ * DistributionPointName ::= CHOICE {
+ *     fullName                 [0] GeneralNames,
+ *     nameRelativeToCRLIssuer  [1] RDN
+ * }
+ * </pre>
+ */
+public class DistributionPointName extends Asn1Choice {
+    private static final int FULL_NAME = 0;
+    private static final int NAME_RELATIVE_TO_CRL_ISSUER = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+        new ExplicitField(FULL_NAME, GeneralNames.class),
+        new ExplicitField(NAME_RELATIVE_TO_CRL_ISSUER, RelativeDistinguishedName.class)
+    };
+
+    public DistributionPointName() {
+        super(fieldInfos);
+    }
+
+    public GeneralNames getFullName() {
+        return getFieldAs(FULL_NAME, GeneralNames.class);
+    }
+
+    public void setFullName(GeneralNames fullName) {
+        setFieldAs(FULL_NAME, fullName);
+    }
+
+    public RelativeDistinguishedName getNameRelativeToCRLIssuer() {
+        return getFieldAs(NAME_RELATIVE_TO_CRL_ISSUER, RelativeDistinguishedName.class);
+    }
+
+    public void setNameRelativeToCrlIssuer(RelativeDistinguishedName nameRelativeToCrlIssuer) {
+        setFieldAs(NAME_RELATIVE_TO_CRL_ISSUER, nameRelativeToCrlIssuer);
+    }
+}