You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pl...@apache.org on 2015/11/27 09:18:22 UTC
[12/17] directory-kerby git commit: DIRKRB-473. Initially added X509
ASN1 types
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/EDIPartyName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/EDIPartyName.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/EDIPartyName.java
new file mode 100644
index 0000000..b908b85
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/EDIPartyName.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.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * <pre>
+ * EDIPartyName ::= SEQUENCE {
+ * nameAssigner [0] DirectoryString OPTIONAL,
+ * partyName [1] DirectoryString
+ * }
+ * </pre>
+ */
+public class EDIPartyName extends Asn1Choice {
+ private static final int NAME_ASSIGNER = 0;
+ private static final int PARTY_NAME = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
+ new ExplicitField(NAME_ASSIGNER, DirectoryString.class),
+ new ExplicitField(PARTY_NAME, DirectoryString.class)
+ };
+
+ public EDIPartyName() {
+ super(fieldInfos);
+ }
+
+ public DirectoryString getNameAssigner() {
+ return getFieldAs(NAME_ASSIGNER, DirectoryString.class);
+ }
+
+ public void setNameAssigner(DirectoryString nameAssigner) {
+ setFieldAs(NAME_ASSIGNER, nameAssigner);
+ }
+
+ public DirectoryString getPartyName() {
+ return getFieldAs(PARTY_NAME, DirectoryString.class);
+ }
+
+ public void setPartyName(DirectoryString partyName) {
+ setFieldAs(PARTY_NAME, partyName);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ExtendedKeyUsage.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ExtendedKeyUsage.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ExtendedKeyUsage.java
new file mode 100644
index 0000000..71ad7c9
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ExtendedKeyUsage.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>
+ * extendedKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
+ * </pre>
+ */
+public class ExtendedKeyUsage extends Asn1SequenceOf<KeyPurposeId> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extension.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extension.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extension.java
new file mode 100644
index 0000000..2275f43
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extension.java
@@ -0,0 +1,77 @@
+/**
+ * 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.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * Ref. X.509 V3 extension
+ * <pre>
+ * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
+ *
+ * Extension ::= SEQUENCE {
+ * extnId EXTENSION.&id ({ExtensionSet}),
+ * critical BOOLEAN DEFAULT FALSE,
+ * extnValue OCTET STRING }
+ * </pre>
+ */
+public class Extension extends Asn1SequenceType {
+ private static final int EXTN_ID = 0;
+ private static final int CRITICAL = 1;
+ private static final int EXTN_VALUE = 2;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(EXTN_ID, Asn1ObjectIdentifier.class),
+ new Asn1FieldInfo(CRITICAL, Asn1Boolean.class),
+ new Asn1FieldInfo(EXTN_VALUE, Asn1OctetString.class)
+ };
+
+ public Extension() {
+ super(fieldInfos);
+ }
+
+ public Asn1ObjectIdentifier getExtnId() {
+ return getFieldAs(EXTN_ID, Asn1ObjectIdentifier.class);
+ }
+
+ public void setExtnId(Asn1ObjectIdentifier extnId) {
+ setFieldAs(EXTN_ID, extnId);
+ }
+
+ public boolean getCritical() {
+ return getFieldAs(CRITICAL, Asn1Boolean.class).getValue();
+ }
+
+ public void setCritical(boolean critical) {
+ setFieldAs(CRITICAL, new Asn1Boolean(critical));
+ }
+
+ public byte[] getExtnValue() {
+ return getFieldAsOctets(EXTN_VALUE);
+ }
+
+ public void setValue(byte[] value) {
+ setFieldAsOctets(EXTN_VALUE, value);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extensions.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extensions.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extensions.java
new file mode 100644
index 0000000..535e78c
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Extensions.java
@@ -0,0 +1,37 @@
+/**
+ * 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>
+ * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
+ *
+ * Extension ::= SEQUENCE {
+ * extnId EXTENSION.&id ({ExtensionSet}),
+ * critical BOOLEAN DEFAULT FALSE,
+ * extnValue OCTET STRING
+ * }
+ * </pre>
+ */
+public class Extensions extends Asn1SequenceOf<Extension> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralName.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralName.java
new file mode 100644
index 0000000..4d93d9b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralName.java
@@ -0,0 +1,147 @@
+/**
+ * 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.Asn1IA5String;
+import org.apache.kerby.asn1.type.Asn1Item;
+import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.ExplicitField;
+import org.apache.kerby.x500.type.Name;
+
+/**
+ *
+ * <pre>
+ * GeneralName ::= CHOICE {
+ * otherName [0] OtherName,
+ * rfc822Name [1] IA5String,
+ * dNSName [2] IA5String,
+ * x400Address [3] ORAddress,
+ * directoryName [4] Name,
+ * ediPartyName [5] EDIPartyName,
+ * uniformResourceIdentifier [6] IA5String,
+ * iPAddress [7] OCTET STRING,
+ * registeredID [8] OBJECT IDENTIFIER
+ * }
+ * </pre>
+ */
+public class GeneralName extends Asn1Choice {
+
+ private static final int OTHER_NAME = 0;
+ private static final int RFC822_NAME = 1;
+ private static final int DNS_NAME = 2;
+ private static final int X400_ADDRESS = 3;
+ private static final int DIRECTORY_NAME = 4;
+ private static final int EDI_PARTY_NAME = 5;
+ private static final int UNIFORM_RESOURCE_IDENTIFIER = 6;
+ private static final int IP_ADDRESS = 7;
+ private static final int REGISTERED_ID = 8;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(OTHER_NAME, OtherName.class),
+ new ExplicitField(RFC822_NAME, Asn1IA5String.class),
+ new ExplicitField(DNS_NAME, Asn1IA5String.class),
+ // ORAddress is to be defined.
+ new ExplicitField(X400_ADDRESS, Asn1Item.class),
+ new ExplicitField(DIRECTORY_NAME, Name.class),
+ new ExplicitField(EDI_PARTY_NAME, EDIPartyName.class),
+ new ExplicitField(UNIFORM_RESOURCE_IDENTIFIER, Asn1IA5String.class),
+ new ExplicitField(IP_ADDRESS, Asn1OctetString.class),
+ new ExplicitField(REGISTERED_ID, Asn1ObjectIdentifier.class)
+ };
+
+ public GeneralName() {
+ super(fieldInfos);
+ }
+
+ public OtherName getOtherName() {
+ return getFieldAs(OTHER_NAME, OtherName.class);
+ }
+
+ public void setOtherName(OtherName otherName) {
+ setFieldAs(OTHER_NAME, otherName);
+ }
+
+ public Asn1IA5String getRfc822Name() {
+ return getFieldAs(RFC822_NAME, Asn1IA5String.class);
+ }
+
+ public void setRfc822Name(Asn1IA5String rfc822Name) {
+ setFieldAs(RFC822_NAME, rfc822Name);
+ }
+
+ public Asn1IA5String getDNSName() {
+ return getFieldAs(DNS_NAME, Asn1IA5String.class);
+ }
+
+ public void setDNSName(Asn1IA5String dnsName) {
+ setFieldAs(DNS_NAME, dnsName);
+ }
+
+ public Asn1Item getX400Address() {
+ return getFieldAs(X400_ADDRESS, Asn1Item.class);
+ }
+
+ public void setX400Address(Asn1Item x400Address) {
+ setFieldAs(X400_ADDRESS, x400Address);
+ }
+
+ public Name getDirectoryName() {
+ return getFieldAs(DIRECTORY_NAME,Name.class);
+ }
+
+ public void setDirectoryName(Name directoryName) {
+ setFieldAs(DIRECTORY_NAME, directoryName);
+ }
+
+ public EDIPartyName getEdiPartyName() {
+ return getFieldAs(EDI_PARTY_NAME, EDIPartyName.class);
+ }
+
+ public void setEdiPartyName(EDIPartyName ediPartyName) {
+ setFieldAs(EDI_PARTY_NAME, ediPartyName);
+ }
+
+ public Asn1IA5String getUniformResourceIdentifier() {
+ return getFieldAs(UNIFORM_RESOURCE_IDENTIFIER, Asn1IA5String.class);
+ }
+
+ public void setUniformResourceIdentifier(Asn1IA5String uniformResourceIdentifier) {
+ setFieldAs(UNIFORM_RESOURCE_IDENTIFIER, uniformResourceIdentifier);
+ }
+
+ public Asn1OctetString getIPAddress() {
+ return getFieldAs(IP_ADDRESS, Asn1OctetString.class);
+ }
+
+ public void setIpAddress(Asn1OctetString ipAddress) {
+ setFieldAs(IP_ADDRESS, ipAddress);
+ }
+
+ public Asn1ObjectIdentifier getRegisteredID() {
+ return getFieldAs(REGISTERED_ID, Asn1ObjectIdentifier.class);
+ }
+
+ public void setRegisteredID(Asn1ObjectIdentifier registeredID) {
+ setFieldAs(REGISTERED_ID, registeredID);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralNames.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralNames.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralNames.java
new file mode 100644
index 0000000..87a8027
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralNames.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.Asn1SequenceOf;
+
+public class GeneralNames extends Asn1SequenceOf<GeneralName> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtree.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtree.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtree.java
new file mode 100644
index 0000000..91cacba
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtree.java
@@ -0,0 +1,77 @@
+/**
+ * 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 org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ *
+ * Ref. RFC 3280.
+ * <pre>
+ * GeneralSubtree ::= SEQUENCE {
+ * base GeneralName,
+ * minimum [0] BaseDistance DEFAULT 0,
+ * maximum [1] BaseDistance OPTIONAL
+ * }
+ * </pre>
+ *
+ */
+public class GeneralSubtree extends Asn1SequenceType {
+ private static final int BASE = 0;
+ private static final int MINIMUM = 1;
+ private static final int MAXMUM = 2;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(BASE, GeneralName.class),
+ new ExplicitField(MINIMUM, 0, Asn1Integer.class),
+ new ExplicitField(MAXMUM, 1, Asn1Integer.class)
+ };
+
+ public GeneralSubtree() {
+ super(fieldInfos);
+ }
+
+ public GeneralName getBase() {
+ return getFieldAs(BASE, GeneralName.class);
+ }
+
+ public void setBase(GeneralName base) {
+ setFieldAs(BASE, base);
+ }
+
+ public int getMinimum() {
+ return getFieldAsInteger(MINIMUM);
+ }
+
+ public void setMinimum(int minimum) {
+ setFieldAsInt(MINIMUM, minimum);
+ }
+
+ public int getMaximum() {
+ return getFieldAsInteger(MAXMUM);
+ }
+
+ public void setMaxmum(int maxmum) {
+ setFieldAsInt(MAXMUM, maxmum);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtrees.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtrees.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtrees.java
new file mode 100644
index 0000000..267d22d
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/GeneralSubtrees.java
@@ -0,0 +1,25 @@
+/**
+ * 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;
+
+public class GeneralSubtrees extends Asn1SequenceOf<GeneralSubtree>{
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Holder.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Holder.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Holder.java
new file mode 100644
index 0000000..abc8d45
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/Holder.java
@@ -0,0 +1,78 @@
+/**
+ * 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>
+ * Holder ::= SEQUENCE {
+ * baseCertificateID [0] IssuerSerial OPTIONAL,
+ * -- the issuer and serial number of
+ * -- the holder's Public Key Certificate
+ * entityName [1] GeneralNames OPTIONAL,
+ * -- the name of the claimant or role
+ * objectDigestInfo [2] ObjectDigestInfo OPTIONAL
+ * -- used to directly authenticate the holder,
+ * -- for example, an executable
+ * }
+ * </pre>
+ */
+public class Holder extends Asn1SequenceType {
+ private static final int BASE_CERTIFICATE_ID = 0;
+ private static final int ENTITY_NAME = 1;
+ private static final int OBJECT_DIGEST_INFO = 2;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(BASE_CERTIFICATE_ID, IssuerSerial.class),
+ new ExplicitField(ENTITY_NAME, GeneralNames.class),
+ new ExplicitField(OBJECT_DIGEST_INFO, ObjectDigestInfo.class)
+ };
+
+ public Holder() {
+ super(fieldInfos);
+ }
+
+ public IssuerSerial getBaseCertificateID() {
+ return getFieldAs(BASE_CERTIFICATE_ID, IssuerSerial.class);
+ }
+
+ public void setBaseCertificateId(IssuerSerial baseCertificateId) {
+ setFieldAs(BASE_CERTIFICATE_ID, baseCertificateId);
+ }
+
+ public GeneralNames getEntityName() {
+ return getFieldAs(ENTITY_NAME, GeneralNames.class);
+ }
+
+ public void setEntityName(GeneralNames entityName) {
+ setFieldAs(ENTITY_NAME, entityName);
+ }
+
+ public ObjectDigestInfo getObjectDigestInfo() {
+ return getFieldAs(OBJECT_DIGEST_INFO, ObjectDigestInfo.class);
+ }
+
+ public void setObjectDigestInfo(ObjectDigestInfo objectDigestInfo) {
+ setFieldAs(OBJECT_DIGEST_INFO, objectDigestInfo);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntax.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntax.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntax.java
new file mode 100644
index 0000000..ada014b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntax.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.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * Ref. RFC3281
+ * <pre>
+ *
+ * IetfAttrSyntax ::= SEQUENCE {
+ * policyAuthority [0] GeneralNames OPTIONAL,
+ * values SEQUENCE OF CHOICE {
+ * octets OCTET STRING,
+ * oid OBJECT IDENTIFIER,
+ * string UTF8String
+ * }
+ * }
+ *
+ * </pre>
+ */
+public class IetfAttrSyntax extends Asn1SequenceType {
+ public static final int POLICY_AUTHORITY = 0;
+ public static final int VALUES = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(POLICY_AUTHORITY, GeneralNames.class),
+ new Asn1FieldInfo(VALUES, IetfAttrSyntaxChoices.class)
+ };
+
+ public IetfAttrSyntax() {
+ super(fieldInfos);
+ }
+
+ public GeneralNames getPolicyAuthority() {
+ return getFieldAs(POLICY_AUTHORITY, GeneralNames.class);
+ }
+
+ public void setPolicyAuthority(GeneralNames policyAuthority) {
+ setFieldAs(POLICY_AUTHORITY, policyAuthority);
+ }
+
+ public IetfAttrSyntaxChoices getValues() {
+ return getFieldAs(VALUES, IetfAttrSyntaxChoices.class);
+ }
+
+ public void setValues(IetfAttrSyntaxChoices values) {
+ setFieldAs(VALUES, values);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoice.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoice.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoice.java
new file mode 100644
index 0000000..3a80dca
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoice.java
@@ -0,0 +1,78 @@
+/**
+ * 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.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+
+/**
+ * Ref. RFC3281
+ * <pre>
+ * IetfAttrSyntax ::= SEQUENCE {
+ * policyAuthority [0] GeneralNames OPTIONAL,
+ * values SEQUENCE OF CHOICE {
+ * octets OCTET STRING,
+ * oid OBJECT IDENTIFIER,
+ * string UTF8String
+ * }
+ * }
+ * </pre>
+ */
+public class IetfAttrSyntaxChoice extends Asn1Choice {
+ public static final int OCTETS = 1;
+ public static final int OID = 2;
+ public static final int UTF8 = 3;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(OCTETS, Asn1OctetString.class),
+ new Asn1FieldInfo(OID, Asn1ObjectIdentifier.class),
+ new Asn1FieldInfo(UTF8, Asn1ObjectIdentifier.class)
+ };
+
+ public IetfAttrSyntaxChoice() {
+ super(fieldInfos);
+ }
+
+ public Asn1OctetString getOctets() {
+ return getFieldAs(OCTETS, Asn1OctetString.class);
+ }
+
+ public void setOctets(Asn1OctetString octets) {
+ setFieldAs(OCTETS, octets);
+ }
+
+ public Asn1ObjectIdentifier getOid() {
+ return getFieldAs(OID, Asn1ObjectIdentifier.class);
+ }
+
+ public void setOid(Asn1ObjectIdentifier oid) {
+ setFieldAs(OID, oid);
+ }
+
+ public Asn1ObjectIdentifier getUtf8() {
+ return getFieldAs(UTF8, Asn1ObjectIdentifier.class);
+ }
+
+ public void setUtf8(Asn1ObjectIdentifier utf8) {
+ setFieldAs(UTF8, utf8);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoices.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoices.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoices.java
new file mode 100644
index 0000000..04dd22e
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IetfAttrSyntaxChoices.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.Asn1SequenceOf;
+
+public class IetfAttrSyntaxChoices extends Asn1SequenceOf<IetfAttrSyntaxChoice> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuerSerial.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuerSerial.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuerSerial.java
new file mode 100644
index 0000000..999ae11
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuerSerial.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>
+ * IssuerSerial ::= SEQUENCE {
+ * issuer GeneralNames,
+ * serial CertificateSerialNumber,
+ * issuerUID UniqueIdentifier OPTIONAL
+ * }
+ * </pre>
+ */
+public class IssuerSerial extends Asn1SequenceType {
+ private static final int ISSUER = 0;
+ private static final int SERIAL = 1;
+ private static final int ISSUER_UID = 2;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(ISSUER, GeneralNames.class),
+ new Asn1FieldInfo(SERIAL, CertificateSerialNumber.class),
+ new Asn1FieldInfo(ISSUER_UID, Asn1BitString.class)
+ };
+
+ public IssuerSerial() {
+ super(fieldInfos);
+ }
+
+ public GeneralNames getIssuer() {
+ return getFieldAs(ISSUER, GeneralNames.class);
+ }
+
+ public void setIssuer(GeneralNames issuer) {
+ setFieldAs(ISSUER, issuer);
+ }
+
+ public CertificateSerialNumber getSerial() {
+ return getFieldAs(SERIAL, CertificateSerialNumber.class);
+ }
+
+ public void setSerial(CertificateSerialNumber serial) {
+ setFieldAs(SERIAL, serial);
+ }
+
+ public Asn1BitString getIssuerUID() {
+ return getFieldAs(ISSUER_UID, Asn1BitString.class);
+ }
+
+ public void setIssuerUID(Asn1BitString issuerUID) {
+ setFieldAs(ISSUER_UID, issuerUID);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
new file mode 100644
index 0000000..f2c724b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/IssuingDistributionPoint.java
@@ -0,0 +1,107 @@
+/**
+ * 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.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * <pre>
+ * IssuingDistributionPoint ::= SEQUENCE {
+ * distributionPoint [0] DistributionPointName OPTIONAL,
+ * onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
+ * onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
+ * onlySomeReasons [3] ReasonFlags OPTIONAL,
+ * indirectCRL [4] BOOLEAN DEFAULT FALSE,
+ * onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE
+ * }
+ * </pre>
+ */
+public class IssuingDistributionPoint extends Asn1SequenceType {
+ private static final int DISTRIBUTION_POINT = 0;
+ private static final int ONLY_CONTAINS_USER_CERTS = 1;
+ private static final int ONLY_CONTAINS_CA_CERTS = 2;
+ private static final int ONLY_SOME_REASONS = 3;
+ private static final int INDIRECT_CRL = 4;
+ private static final int ONLY_CONTAINS_ATTRIBUTE_CERTS = 5;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(DISTRIBUTION_POINT, DistributionPointName.class),
+ new ExplicitField(ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class),
+ new ExplicitField(ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class),
+ new ExplicitField(ONLY_SOME_REASONS, ReasonFlags.class),
+ new ExplicitField(INDIRECT_CRL, Asn1Boolean.class),
+ new ExplicitField(ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class)
+ };
+
+ public IssuingDistributionPoint() {
+ super(fieldInfos);
+ }
+
+ public DistributionPointName getDistributionPoint() {
+ return getFieldAs(DISTRIBUTION_POINT, DistributionPointName.class);
+ }
+
+ public void setDistributionPoint(DistributionPointName distributionPoint) {
+ setFieldAs(DISTRIBUTION_POINT, distributionPoint);
+ }
+
+ public boolean getOnlyContainsUserCerts() {
+ return getFieldAs(ONLY_CONTAINS_USER_CERTS, Asn1Boolean.class).getValue();
+ }
+
+ public void setOnlyContainsUserCerts(boolean onlyContainsUserCerts) {
+ setFieldAs(ONLY_CONTAINS_USER_CERTS, new Asn1Boolean(onlyContainsUserCerts));
+ }
+
+ public boolean getOnlyContainsCACerts() {
+ return getFieldAs(ONLY_CONTAINS_CA_CERTS, Asn1Boolean.class).getValue();
+ }
+
+ public void setOnlyContainsCaCerts(boolean onlyContainsCaCerts) {
+ setFieldAs(ONLY_CONTAINS_CA_CERTS, new Asn1Boolean(onlyContainsCaCerts));
+ }
+
+ public ReasonFlags getOnlySomeReasons() {
+ return getFieldAs(ONLY_SOME_REASONS, ReasonFlags.class);
+ }
+
+ public void setOnlySomeReasons(ReasonFlags onlySomeReasons) {
+ setFieldAs(ONLY_SOME_REASONS, onlySomeReasons);
+ }
+
+ public boolean getIndirectCRL() {
+ return getFieldAs(INDIRECT_CRL, Asn1Boolean.class).getValue();
+ }
+
+ public void setIndirectCrl(boolean indirectCrl) {
+ setFieldAs(INDIRECT_CRL, new Asn1Boolean(indirectCrl));
+ }
+
+ public boolean getOnlyContainsAttributeCerts() {
+ return getFieldAs(ONLY_CONTAINS_ATTRIBUTE_CERTS, Asn1Boolean.class).getValue();
+ }
+
+ public void setOnlyContainsAttributeCerts(boolean onlyContainsAttributeCerts) {
+ setFieldAs(ONLY_CONTAINS_ATTRIBUTE_CERTS, new Asn1Boolean(onlyContainsAttributeCerts));
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyIdentifier.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyIdentifier.java
new file mode 100644
index 0000000..52f6d09
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyIdentifier.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.Asn1OctetString;
+
+/**
+ *
+ * <pre>
+ * KeyIdentifier ::= OCTET STRING
+ * </pre>
+ *
+ */
+public class KeyIdentifier extends Asn1OctetString {
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyPurposeId.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyPurposeId.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyPurposeId.java
new file mode 100644
index 0000000..a0e1424
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyPurposeId.java
@@ -0,0 +1,36 @@
+/**
+ * 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>
+ * KeyPurposeId ::= OBJECT IDENTIFIER
+ *
+ * id-kp ::= OBJECT IDENTIFIER { iso(1) identified-organization(3)
+ * dod(6) internet(1) security(5) mechanisms(5) pkix(7) 3}
+ *
+ * </pre>
+ */
+public class KeyPurposeId extends Asn1ObjectIdentifier {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyUsage.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyUsage.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyUsage.java
new file mode 100644
index 0000000..bbded47
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/KeyUsage.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.Asn1EnumType;
+import org.apache.kerby.asn1.type.Asn1Flags;
+
+/**
+ * The KeyUsage object.
+ * <pre>
+ * id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 }
+ *
+ * KeyUsage ::= BIT STRING {
+ * digitalSignature (0),
+ * nonRepudiation (1),
+ * keyEncipherment (2),
+ * dataEncipherment (3),
+ * keyAgreement (4),
+ * keyCertSign (5),
+ * cRLSign (6),
+ * encipherOnly (7),
+ * decipherOnly (8) }
+ * </pre>
+ */
+
+enum KeyUsageEnum implements Asn1EnumType {
+ DIGITAL_SIGNATURE,
+ NON_REPUDIATION,
+ KEY_ENCIPHERMENT,
+ DATA_ENCIPHERMENT,
+ KEY_AGREEMENT,
+ KEY_CERT_SIGN,
+ CRL_SIGN,
+ ENCIPHER_ONLY,
+ DECIPHER_ONLY;
+
+ @Override
+ public int getValue() {
+ return ordinal();
+ }
+}
+
+public class KeyUsage extends Asn1Flags {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
new file mode 100644
index 0000000..8d12f42
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NameConstraints.java
@@ -0,0 +1,60 @@
+/**
+ * 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;
+
+/*
+ * NameConstraints ::= SEQUENCE {
+ * permittedSubtrees [0] GeneralSubtrees OPTIONAL,
+ * excludedSubtrees [1] GeneralSubtrees OPTIONAL
+ * }
+ */
+public class NameConstraints extends Asn1SequenceType {
+ private static final int PERMITTED_SUBTREES = 0;
+ private static final int EXCLUDED_SUBTREES = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(PERMITTED_SUBTREES, GeneralSubtrees.class),
+ new ExplicitField(EXCLUDED_SUBTREES, GeneralSubtrees.class)
+ };
+
+ public NameConstraints() {
+ super(fieldInfos);
+ }
+
+ public GeneralSubtrees getPermittedSubtrees() {
+ return getFieldAs(PERMITTED_SUBTREES, GeneralSubtrees.class);
+ }
+
+ public void setPermittedSubtrees(GeneralSubtrees permittedSubtrees) {
+ setFieldAs(PERMITTED_SUBTREES, permittedSubtrees);
+ }
+
+ public GeneralSubtrees getExcludedSubtrees() {
+ return getFieldAs(EXCLUDED_SUBTREES, GeneralSubtrees.class);
+ }
+
+ public void setExcludedSubtrees(GeneralSubtrees excludedSubtrees) {
+ setFieldAs(EXCLUDED_SUBTREES, excludedSubtrees);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeNumbers.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeNumbers.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeNumbers.java
new file mode 100644
index 0000000..798e905
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeNumbers.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;
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+
+/**
+ * <pre>
+ * noticeNumbers ::= SEQUENCE OF INTEGER }
+ * </pre>
+ */
+public class NoticeNumbers extends Asn1SequenceOf<Asn1Integer> {
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.java
new file mode 100644
index 0000000..a64ef07
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/NoticeReference.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.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * <pre>
+ * NoticeReference ::= SEQUENCE {
+ * organization DisplayText,
+ * noticeNumbers SEQUENCE OF INTEGER
+ * }
+ *
+ * </pre>
+ *
+ */
+public class NoticeReference extends Asn1SequenceType {
+ private static final int ORGANIZATION = 0;
+ private static final int NOTICE_NUMBERS = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(ORGANIZATION, DisplayText.class),
+ new Asn1FieldInfo(NOTICE_NUMBERS, NoticeNumbers.class)
+ };
+
+ public NoticeReference() {
+ super(fieldInfos);
+ }
+
+ public DisplayText getOrganization() {
+ return getFieldAs(ORGANIZATION, DisplayText.class);
+ }
+
+ public void setOrganization(DisplayText organization) {
+ setFieldAs(ORGANIZATION, organization);
+ }
+
+ public NoticeNumbers getNoticeNumbers() {
+ return getFieldAs(NOTICE_NUMBERS, NoticeNumbers.class);
+ }
+
+ public void setNoticeNumbers(NoticeNumbers noticeNumbers) {
+ setFieldAs(NOTICE_NUMBERS, noticeNumbers);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
new file mode 100644
index 0000000..f6b7c5f
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ObjectDigestInfo.java
@@ -0,0 +1,93 @@
+/**
+ * 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.Asn1ObjectIdentifier;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ *
+ * <pre>
+ * ObjectDigestInfo ::= SEQUENCE {
+ * digestedObjectType ENUMERATED {
+ * publicKey (0),
+ * publicKeyCert (1),
+ * otherObjectTypes (2) },
+ * -- otherObjectTypes MUST NOT
+ * -- be used in this profile
+ * otherObjectTypeID OBJECT IDENTIFIER OPTIONAL,
+ * digestAlgorithm AlgorithmIdentifier,
+ * objectDigest BIT STRING
+ * }
+ *
+ * </pre>
+ *
+ */
+public class ObjectDigestInfo extends Asn1SequenceType {
+ private static final int DIGESTED_OBJECT_TYPE = 0;
+ private static final int OTHER_OBJECT_TYPE_ID = 1;
+ private static final int DIGEST_ALGORITHM = 2;
+ private static final int OBJECT_DIGEST = 3;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(DIGESTED_OBJECT_TYPE, DigestedObjectType.class),
+ new Asn1FieldInfo(OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class),
+ new Asn1FieldInfo(DIGEST_ALGORITHM, AlgorithmIdentifier.class),
+ new Asn1FieldInfo(OBJECT_DIGEST, Asn1BitString.class)
+ };
+
+ public ObjectDigestInfo() {
+ super(fieldInfos);
+ }
+
+ public DigestedObjectType getDigestedObjectType() {
+ return getFieldAs(DIGESTED_OBJECT_TYPE, DigestedObjectType.class);
+ }
+
+ public void setDigestedObjectType(DigestedObjectType digestedObjectType) {
+ setFieldAs(DIGESTED_OBJECT_TYPE, digestedObjectType);
+ }
+
+ public Asn1ObjectIdentifier getOtherObjectTypeID() {
+ return getFieldAs(OTHER_OBJECT_TYPE_ID, Asn1ObjectIdentifier.class);
+ }
+
+ public void setOtherObjectTypeId(Asn1ObjectIdentifier otherObjectTypeID) {
+ setFieldAs(OTHER_OBJECT_TYPE_ID, otherObjectTypeID);
+ }
+
+ public AlgorithmIdentifier getDigestAlgorithm() {
+ return getFieldAs(DIGEST_ALGORITHM, AlgorithmIdentifier.class);
+ }
+
+ public void setDigestAlgorithm(AlgorithmIdentifier digestAlgorithm) {
+ setFieldAs(DIGEST_ALGORITHM, digestAlgorithm);
+ }
+
+ public Asn1BitString getObjectDigest() {
+ return getFieldAs(OBJECT_DIGEST, Asn1BitString.class);
+ }
+
+ public void setObjectDigest(Asn1BitString objectDigest) {
+ setFieldAs(OBJECT_DIGEST, objectDigest);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.java
new file mode 100644
index 0000000..d2f11ab
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/OtherName.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.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;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * <pre>
+ * OtherName ::= SEQUENCE {
+ * type-id OBJECT IDENTIFIER,
+ * value [0] EXPLICIT ANY DEFINED BY type-id
+ * }
+ *
+ * </pre>
+ */
+public class OtherName extends Asn1SequenceType {
+ private static final int TYPE_ID = 0;
+ private static final int VALUE = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(TYPE_ID, Asn1ObjectIdentifier.class),
+ new ExplicitField(VALUE, 0, Asn1Any.class)
+ };
+
+ public OtherName() {
+ super(fieldInfos);
+ }
+
+ public Asn1ObjectIdentifier getTypeId() {
+ return getFieldAs(TYPE_ID, Asn1ObjectIdentifier.class);
+ }
+
+ public void setTypeId(Asn1ObjectIdentifier algorithm) {
+ setFieldAs(TYPE_ID, algorithm);
+ }
+
+ public Asn1Type getOtherNameValue() {
+ return getFieldAsAny(VALUE);
+ }
+
+ public void setOtherNameValue(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/x509/type/PolicyConstraints.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
new file mode 100644
index 0000000..874f99f
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyConstraints.java
@@ -0,0 +1,67 @@
+/**
+ * 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 org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * Ref. RFC 5280
+ * <pre>
+ * id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 }
+ *
+ * PolicyConstraints ::= SEQUENCE {
+ * requireExplicitPolicy [0] SkipCerts OPTIONAL,
+ * inhibitPolicyMapping [1] SkipCerts OPTIONAL }
+ *
+ * SkipCerts ::= INTEGER (0..MAX)
+ * </pre>
+ */
+public class PolicyConstraints extends Asn1SequenceType {
+ private static final int REQUIRE_EXPLICIT_POLICY = 0;
+ private static final int INHIBIT_POLICY_MAPPING = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(REQUIRE_EXPLICIT_POLICY, Asn1Integer.class),
+ new ExplicitField(INHIBIT_POLICY_MAPPING, Asn1Integer.class)
+ };
+
+ public PolicyConstraints() {
+ super(fieldInfos);
+ }
+
+ public Asn1Integer getRequireExplicitPolicy() {
+ return getFieldAs(REQUIRE_EXPLICIT_POLICY, Asn1Integer.class);
+ }
+
+ public void setRequireExplicitPolicy(Asn1Integer requireExplicitPolicy) {
+ setFieldAs(REQUIRE_EXPLICIT_POLICY, requireExplicitPolicy);
+ }
+
+ public Asn1Integer getInhibitPolicyMapping() {
+ return getFieldAs(INHIBIT_POLICY_MAPPING, Asn1Integer.class);
+ }
+
+ public void setInhibitPolicyMapping(Asn1Integer inhibitPolicyMapping) {
+ setFieldAs(INHIBIT_POLICY_MAPPING, inhibitPolicyMapping);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.java
new file mode 100644
index 0000000..481eb2e
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyInformation.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.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/*
+ * <pre>
+ * PolicyInformation ::= SEQUENCE {
+ * policyIdentifier CertPolicyId,
+ * policyQualifiers SEQUENCE SIZE (1..MAX) OF
+ * PolicyQualifierInfo OPTIONAL }
+ * </pre>
+ */
+public class PolicyInformation extends Asn1SequenceType {
+ private static final int POLICY_IDENTIFIER = 0;
+ private static final int POLICY_QUALIFIERS = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(POLICY_IDENTIFIER, CertPolicyId.class),
+ new Asn1FieldInfo(POLICY_QUALIFIERS, PolicyQualifierInfos.class)
+ };
+
+ public PolicyInformation() {
+ super(fieldInfos);
+ }
+
+ public CertPolicyId getPolicyIdentifier() {
+ return getFieldAs(POLICY_IDENTIFIER, CertPolicyId.class);
+ }
+
+ public void setPolicyIdentifier(CertPolicyId policyIdentifier) {
+ setFieldAs(POLICY_IDENTIFIER, policyIdentifier);
+ }
+
+ public PolicyQualifierInfos getPolicyQualifiers() {
+ return getFieldAs(POLICY_QUALIFIERS, PolicyQualifierInfos.class);
+ }
+
+ public void setPolicyQualifiers(PolicyQualifierInfos policyQualifiers) {
+ setFieldAs(POLICY_QUALIFIERS, policyQualifiers);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.java
new file mode 100644
index 0000000..aa764d5
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMapping.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.Asn1SequenceType;
+
+/**
+ * Ref. RFC3280
+ * <pre>
+ * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
+ * issuerDomainPolicy CertPolicyId,
+ * subjectDomainPolicy CertPolicyId }
+ * </pre>
+ *
+ */
+public class PolicyMapping extends Asn1SequenceType {
+ private static final int ISSUER_DOMAIN_POLICY = 0;
+ private static final int SUBJECT_DOMAIN_POLICY = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(ISSUER_DOMAIN_POLICY, CertPolicyId.class),
+ new Asn1FieldInfo(SUBJECT_DOMAIN_POLICY, CertPolicyId.class)
+ };
+
+ public PolicyMapping() {
+ super(fieldInfos);
+ }
+
+ public CertPolicyId getIssuerDomainPolicy() {
+ return getFieldAs(ISSUER_DOMAIN_POLICY, CertPolicyId.class);
+ }
+
+ public void setIssuerDomainPolicy(CertPolicyId issuerDomainPolicy) {
+ setFieldAs(ISSUER_DOMAIN_POLICY, issuerDomainPolicy);
+ }
+
+ public CertPolicyId getSubjectDomainPolicy() {
+ return getFieldAs(SUBJECT_DOMAIN_POLICY, CertPolicyId.class);
+ }
+
+ public void setSubjectDomainPolicy(CertPolicyId subjectDomainPolicy) {
+ setFieldAs(SUBJECT_DOMAIN_POLICY, subjectDomainPolicy);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMappings.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMappings.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMappings.java
new file mode 100644
index 0000000..15f1a3b
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyMappings.java
@@ -0,0 +1,34 @@
+/**
+ * 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. RFC3280.
+ * <pre>
+ * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF SEQUENCE {
+ * issuerDomainPolicy CertPolicyId,
+ * subjectDomainPolicy CertPolicyId }
+ * </pre>
+ */
+public class PolicyMappings extends Asn1SequenceOf<PolicyMapping> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierId.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierId.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierId.java
new file mode 100644
index 0000000..b8895ef
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierId.java
@@ -0,0 +1,46 @@
+/**
+ * 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>
+ * id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
+ * id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
+ * id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
+ * PolicyQualifierId ::=
+ * OBJECT IDENTIFIER (id-qt-cps | id-qt-unotice)
+ * </pre>
+ */
+public class PolicyQualifierId extends Asn1ObjectIdentifier
+{
+ private static final String id_qt = "1.3.6.1.5.5.7.2";
+
+ private PolicyQualifierId(String id)
+ {
+ super(id);
+ }
+
+ public static final PolicyQualifierId id_qt_cps =
+ new PolicyQualifierId(id_qt + ".1");
+ public static final PolicyQualifierId id_qt_unotice =
+ new PolicyQualifierId(id_qt + ".2");
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.java
new file mode 100644
index 0000000..16832a7
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfo.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.Asn1Any;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.Asn1Type;
+
+/**
+ *
+ * <pre>
+ * PolicyQualifierInfo ::= SEQUENCE {
+ * policyQualifierId PolicyQualifierId,
+ * qualifier ANY DEFINED BY policyQualifierId
+ * }
+ *
+ * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
+ * </pre>
+ */
+public class PolicyQualifierInfo extends Asn1SequenceType {
+ private static final int POLICY_QUALIFIER_ID = 0;
+ private static final int QUALIFIER = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(POLICY_QUALIFIER_ID, PolicyQualifierId.class),
+ new Asn1FieldInfo(QUALIFIER, Asn1Any.class)
+ };
+
+ public PolicyQualifierInfo() {
+ super(fieldInfos);
+ }
+
+ public PolicyQualifierId getPolicyQualifierId() {
+ return getFieldAs(POLICY_QUALIFIER_ID, PolicyQualifierId.class);
+ }
+
+ public void setPolicyQualifierId(PolicyQualifierId policyQualifierId) {
+ setFieldAs(POLICY_QUALIFIER_ID, policyQualifierId);
+ }
+
+ public Asn1Type getQualifier() {
+ return getFieldAsAny(QUALIFIER);
+ }
+
+ public void setQualifier(Asn1Type qualifier) {
+ setFieldAsAny(QUALIFIER, qualifier);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfos.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfos.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfos.java
new file mode 100644
index 0000000..f6e1695
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PolicyQualifierInfos.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>
+ * policyQualifiers SEQUENCE SIZE (1..MAX) OF
+ * PolicyQualifierInfo OPTIONAL
+ * </pre>
+ */
+public class PolicyQualifierInfos extends Asn1SequenceOf<PolicyQualifierInfo> {
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.java
new file mode 100644
index 0000000..86b6b83
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/PrivateKeyUsagePeriod.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.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1GeneralizedTime;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ * <pre>
+ * PrivateKeyUsagePeriod ::= SEQUENCE {
+ * notBefore [0] GeneralizedTime OPTIONAL,
+ * notAfter [1] GeneralizedTime OPTIONAL
+ * }
+ * </pre>
+ */
+public class PrivateKeyUsagePeriod extends Asn1SequenceType {
+ private static final int NOT_BEFORE = 0;
+ private static final int NOT_AFTER = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(NOT_BEFORE, Asn1GeneralizedTime.class),
+ new ExplicitField(NOT_AFTER, Asn1GeneralizedTime.class)
+ };
+
+ public PrivateKeyUsagePeriod() {
+ 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/ReasonFlags.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ReasonFlags.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ReasonFlags.java
new file mode 100644
index 0000000..c397f08
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/ReasonFlags.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.Asn1EnumType;
+import org.apache.kerby.asn1.type.Asn1Flags;
+
+/**
+ *
+ * <pre>
+ * ReasonFlags ::= BIT STRING {
+ * unused (0),
+ * keyCompromise (1),
+ * cACompromise (2),
+ * affiliationChanged (3),
+ * superseded (4),
+ * cessationOfOperation (5),
+ * certificateHold (6),
+ * privilegeWithdrawn (7),
+ * aACompromise (8)
+ * }
+ * </pre>
+ */
+
+enum ReasonFlagsEnum implements Asn1EnumType {
+ UNUSED,
+ KEY_COMPROMISE,
+ CA_COMPROMISE,
+ AFFILIATION_CHANGED,
+ SUPERSEDED,
+ CESSATION_OF_OPERATION,
+ CERTIFICATE_HOLD,
+ PRIVILEGE_WITH_DRAWN,
+ AA_COMPROMISE;
+
+ @Override
+ public int getValue() {
+ return ordinal();
+ }
+}
+
+public class ReasonFlags extends Asn1Flags {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.java
new file mode 100644
index 0000000..034e418
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificate.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.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+/**
+ * Ref. RFC 2459
+ *
+ * <pre>
+ * SEQUENCE {
+ * userCertificate CertificateSerialNumber,
+ * revocationDate Time,
+ * crlEntryExtensions Extensions OPTIONAL
+ * -- if present, shall be v2
+ * }
+ * </pre>
+ */
+public class RevokedCertificate extends Asn1SequenceType {
+ private static final int USER_CERTIFICATE = 0;
+ private static final int REVOCATION_DATA = 1;
+ private static final int CRL_ENTRY_EXTENSIONS = 2;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new Asn1FieldInfo(USER_CERTIFICATE, CertificateSerialNumber.class),
+ new Asn1FieldInfo(REVOCATION_DATA, Time.class),
+ new Asn1FieldInfo(CRL_ENTRY_EXTENSIONS, Extensions.class)
+ };
+
+ public RevokedCertificate() {
+ super(fieldInfos);
+ }
+
+ public CertificateSerialNumber getUserCertificate() {
+ return getFieldAs(USER_CERTIFICATE, CertificateSerialNumber.class);
+ }
+
+ public void setUserCertificate(CertificateSerialNumber userCertificate) {
+ setFieldAs(USER_CERTIFICATE, userCertificate);
+ }
+
+ public Time getRevocationDate() {
+ return getFieldAs(REVOCATION_DATA, Time.class);
+ }
+
+ public void setRevocationData(Time revocationData) {
+ setFieldAs(REVOCATION_DATA, revocationData);
+ }
+
+ public Extensions getCrlEntryExtensions() {
+ return getFieldAs(CRL_ENTRY_EXTENSIONS, Extensions.class);
+ }
+
+ public void setCrlEntryExtensions(Extensions crlEntryExtensions) {
+ setFieldAs(CRL_ENTRY_EXTENSIONS, crlEntryExtensions);
+ }
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificates.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificates.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificates.java
new file mode 100644
index 0000000..ba12886
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RevokedCertificates.java
@@ -0,0 +1,38 @@
+/**
+ * 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-2459
+ * <pre>
+ * revokedCertificates SEQUENCE OF SEQUENCE {
+ * userCertificate CertificateSerialNumber,
+ * revocationDate Time,
+ * crlEntryExtensions Extensions OPTIONAL
+ * -- if present, shall be v2
+ * }
+ *
+ * </pre>
+ */
+public class RevokedCertificates extends Asn1SequenceOf<RevokedCertificate> {
+
+}
http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/93bcd6fe/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.java
new file mode 100644
index 0000000..712b33f
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/RoleSyntax.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.x509.type;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+import org.apache.kerby.asn1.type.ExplicitField;
+
+/**
+ *Ref. RFC3281
+ * <pre>
+ * RoleSyntax ::= SEQUENCE {
+ * roleAuthority [0] GeneralNames OPTIONAL,
+ * roleName [1] GeneralName
+ * }
+ * </pre>
+ */
+public class RoleSyntax extends Asn1SequenceType {
+ private static final int ROLE_AUTHORITY = 0;
+ private static final int ROLE_NAME = 1;
+
+ static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+ new ExplicitField(ROLE_AUTHORITY, GeneralNames.class),
+ new ExplicitField(ROLE_NAME, GeneralName.class)
+ };
+
+ public RoleSyntax() {
+ super(fieldInfos);
+ }
+
+ public GeneralNames getRoleAuthority() {
+ return getFieldAs(ROLE_AUTHORITY, GeneralNames.class);
+ }
+
+ public void setRoleAuthority(GeneralNames roleAuthority) {
+ setFieldAs(ROLE_AUTHORITY, roleAuthority);
+ }
+
+ public GeneralName getRoleName() {
+ return getFieldAs(ROLE_NAME, GeneralName.class);
+ }
+
+ public void setRoleName(GeneralName roleName) {
+ setFieldAs(ROLE_NAME, roleName);
+ }
+}