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/01/22 01:56:46 UTC

[22/50] [abbrv] directory-kerberos git commit: Many changes with newname

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/KdcReqBody.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/KdcReqBody.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/KdcReqBody.java
new file mode 100644
index 0000000..6a3506b
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/KdcReqBody.java
@@ -0,0 +1,209 @@
+/**
+ *  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.kerberos.kerb.spec.kdc;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.kerberos.kerb.spec.KerberosString;
+import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
+import org.apache.kerby.kerberos.kerb.spec.KrbIntegers;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.common.*;
+import org.apache.kerby.kerberos.kerb.spec.ticket.Tickets;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ KDC-REQ-BODY    ::= SEQUENCE {
+ kdc-options             [0] KDCOptions,
+ cname                   [1] PrincipalName OPTIONAL
+ -- Used only in AS-REQ --,
+ realm                   [2] Realm
+ -- Server's realm
+ -- Also client's in AS-REQ --,
+ sname                   [3] PrincipalName OPTIONAL,
+ from                    [4] KerberosTime OPTIONAL,
+ till                    [5] KerberosTime,
+ rtime                   [6] KerberosTime OPTIONAL,
+ nonce                   [7] UInt32,
+ etype                   [8] SEQUENCE OF Int32 -- EncryptionType
+ -- in preference order --,
+ addresses               [9] HostAddresses OPTIONAL,
+ enc-authorization-data  [10] EncryptedData OPTIONAL
+ -- AuthorizationData --,
+ additional-tickets      [11] SEQUENCE OF Ticket OPTIONAL
+ -- NOTE: not empty
+ }
+ */
+public class KdcReqBody extends KrbSequenceType {
+    private static int KDC_OPTIONS = 0;
+    private static int CNAME = 1;
+    private static int REALM = 2;
+    private static int SNAME = 3;
+    private static int FROM = 4;
+    private static int TILL = 5;
+    private static int RTIME = 6;
+    private static int NONCE = 7;
+    private static int ETYPE = 8;
+    private static int ADDRESSES = 9;
+    private static int ENC_AUTHORIZATION_DATA = 10;
+    private static int ADDITIONAL_TICKETS = 11;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(KDC_OPTIONS, KdcOptions.class),
+            new Asn1FieldInfo(CNAME, PrincipalName.class),
+            new Asn1FieldInfo(REALM, KerberosString.class),
+            new Asn1FieldInfo(SNAME, PrincipalName.class),
+            new Asn1FieldInfo(FROM, KerberosTime.class),
+            new Asn1FieldInfo(TILL, KerberosTime.class),
+            new Asn1FieldInfo(RTIME, KerberosTime.class),
+            new Asn1FieldInfo(NONCE, Asn1Integer.class),
+            new Asn1FieldInfo(ETYPE, KrbIntegers.class),
+            new Asn1FieldInfo(ADDRESSES, HostAddresses.class),
+            new Asn1FieldInfo(ENC_AUTHORIZATION_DATA, AuthorizationData.class),
+            new Asn1FieldInfo(ADDITIONAL_TICKETS, Tickets.class)
+    };
+
+    public KdcReqBody() {
+        super(fieldInfos);
+    }
+
+    private AuthorizationData authorizationData;
+
+    public KerberosTime getFrom() {
+        return getFieldAs(FROM, KerberosTime.class);
+    }
+
+    public void setFrom(KerberosTime from) {
+        setFieldAs(FROM, from);
+    }
+
+    public KerberosTime getTill() {
+        return getFieldAs(TILL, KerberosTime.class);
+    }
+
+    public void setTill(KerberosTime till) {
+        setFieldAs(TILL, till);
+    }
+
+    public KerberosTime getRtime() {
+        return getFieldAs(RTIME, KerberosTime.class);
+    }
+
+    public void setRtime(KerberosTime rtime) {
+        setFieldAs(RTIME, rtime);
+    }
+
+    public int getNonce() {
+        return getFieldAsInt(NONCE);
+    }
+
+    public void setNonce(int nonce) {
+        setFieldAsInt(NONCE, nonce);
+    }
+
+    public List<EncryptionType> getEtypes() {
+        KrbIntegers values = getFieldAs(ETYPE, KrbIntegers.class);
+        if (values == null) {
+            return Collections.emptyList();
+        }
+
+        List<EncryptionType> results = new ArrayList<EncryptionType>();
+        for (Integer value : values.getValues()) {
+            results.add(EncryptionType.fromValue(value));
+        }
+        return results;
+    }
+
+    public void setEtypes(List<EncryptionType> etypes) {
+        List<Integer> values = new ArrayList<Integer>();
+        for (EncryptionType etype: etypes) {
+            values.add(etype.getValue());
+        }
+        KrbIntegers value = new KrbIntegers(values);
+        setFieldAs(ETYPE, value);
+    }
+
+    public HostAddresses getAddresses() {
+        return getFieldAs(ADDRESSES, HostAddresses.class);
+    }
+
+    public void setAddresses(HostAddresses addresses) {
+        setFieldAs(ADDRESSES, addresses);
+    }
+
+    public EncryptedData getEncryptedAuthorizationData() {
+        return getFieldAs(ENC_AUTHORIZATION_DATA, EncryptedData.class);
+    }
+
+    public void setEncryptedAuthorizationData(EncryptedData encAuthorizationData) {
+        setFieldAs(ENC_AUTHORIZATION_DATA, encAuthorizationData);
+    }
+
+    public AuthorizationData getAuthorizationData() {
+        return authorizationData;
+    }
+
+    public void setAuthorizationData(AuthorizationData authorizationData) {
+        this.authorizationData = authorizationData;
+    }
+
+    public Tickets getAdditionalTickets() {
+        return getFieldAs(ADDITIONAL_TICKETS, Tickets.class);
+    }
+
+    public void setAdditionalTickets(Tickets additionalTickets) {
+        setFieldAs(ADDITIONAL_TICKETS, additionalTickets);
+    }
+
+    public KdcOptions getKdcOptions() {
+        return getFieldAs(KDC_OPTIONS, KdcOptions.class);
+    }
+
+    public void setKdcOptions(KdcOptions kdcOptions) {
+        setFieldAs(KDC_OPTIONS, kdcOptions);
+    }
+
+    public PrincipalName getSname() {
+        return getFieldAs(SNAME, PrincipalName.class);
+    }
+
+    public void setSname(PrincipalName sname) {
+        setFieldAs(SNAME, sname);
+    }
+
+    public PrincipalName getCname() {
+        return getFieldAs(CNAME, PrincipalName.class);
+    }
+
+    public void setCname(PrincipalName cname) {
+        setFieldAs(CNAME, cname);
+    }
+
+    public String getRealm() {
+        return getFieldAsString(REALM);
+    }
+
+    public void setRealm(String realm) {
+        setFieldAs(REALM, new KerberosString(realm));
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsRep.java
new file mode 100644
index 0000000..0e56636
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsRep.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.kerberos.kerb.spec.kdc;
+
+import org.apache.kerby.kerberos.kerb.spec.common.KrbMessageType;
+
+/**
+ TGS-REP         ::= [APPLICATION 13] KDC-REP
+ */
+public class TgsRep extends KdcRep {
+    public TgsRep() {
+        super(KrbMessageType.TGS_REP);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsReq.java
new file mode 100644
index 0000000..4e8153c
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/kdc/TgsReq.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.kerberos.kerb.spec.kdc;
+
+import org.apache.kerby.kerberos.kerb.spec.common.KrbMessageType;
+
+/**
+ TGS-REQ         ::= [APPLICATION 12] KDC-REQ
+ */
+public class TgsReq extends KdcReq {
+
+    public TgsReq() {
+        super(KrbMessageType.TGS_REQ);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSet.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSet.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSet.java
new file mode 100644
index 0000000..922b3c7
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSet.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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+
+/**
+ PA-AUTHENTICATION-SET ::= SEQUENCE OF PA-AUTHENTICATION-SET-ELEM
+ */
+public class PaAuthenticationSet extends KrbSequenceOfType<PaAuthenticationSetElem> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSetElem.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSetElem.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSetElem.java
new file mode 100644
index 0000000..5a484cf
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaAuthenticationSetElem.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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-AUTHENTICATION-SET-ELEM ::= SEQUENCE {
+     pa-type      [0] Int32,
+     -- same as padata-type.
+     pa-hint      [1] OCTET STRING OPTIONAL,
+     pa-value     [2] OCTET STRING OPTIONAL
+ }
+ */
+public class PaAuthenticationSetElem extends KrbSequenceType {
+    private static int PA_TYPE = 0;
+    private static int PA_HINT = 1;
+    private static int PA_VALUE = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(PA_TYPE, Asn1Integer.class),
+            new Asn1FieldInfo(PA_HINT, Asn1OctetString.class),
+            new Asn1FieldInfo(PA_VALUE, Asn1OctetString.class)
+    };
+
+    public PaAuthenticationSetElem() {
+        super(fieldInfos);
+    }
+
+    public PaDataType getPaType() {
+        Integer value = getFieldAsInteger(PA_TYPE);
+        return PaDataType.fromValue(value);
+    }
+
+    public void setPaType(PaDataType paDataType) {
+        setFieldAsInt(PA_TYPE, paDataType.getValue());
+    }
+
+    public byte[] getPaHint() {
+        return getFieldAsOctets(PA_HINT);
+    }
+
+    public void setPaHint(byte[] paHint) {
+        setFieldAsOctets(PA_HINT, paHint);
+    }
+
+    public byte[] getPaValue() {
+        return getFieldAsOctets(PA_VALUE);
+    }
+
+    public void setPaValue(byte[] paDataValue) {
+        setFieldAsOctets(PA_VALUE, paDataValue);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaData.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaData.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaData.java
new file mode 100644
index 0000000..3594a61
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaData.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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+
+/**
+ PA-DATA         ::= SEQUENCE {
+     -- NOTE: first tag is [1], not [0]
+     padata-type     [1] Int32,
+     padata-value    [2] OCTET STRING -- might be encoded AP-REQ
+ }
+ */
+public class PaData extends KrbSequenceOfType<PaDataEntry> {
+
+    public PaDataEntry findEntry(PaDataType paType) {
+        for (PaDataEntry pae : getElements()) {
+            if (pae.getPaDataType() == paType) {
+                return pae;
+            }
+        }
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataEntry.java
new file mode 100644
index 0000000..8f0714b
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataEntry.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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-DATA         ::= SEQUENCE {
+     -- NOTE: first tag is [1], not [0]
+     padata-type     [1] Int32,
+     padata-value    [2] OCTET STRING -- might be encoded AP-REQ
+ }
+ */
+public class PaDataEntry extends KrbSequenceType {
+    private static int PADATA_TYPE = 0;
+    private static int PADATA_VALUE = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(PADATA_TYPE, 1, Asn1Integer.class),
+            new Asn1FieldInfo(PADATA_VALUE, 2, Asn1OctetString.class)
+    };
+
+    public PaDataEntry() {
+        super(fieldInfos);
+    }
+
+    public PaDataEntry(PaDataType type, byte[] paData) {
+        this();
+        setPaDataType(type);
+        setPaDataValue(paData);
+    }
+
+    public PaDataType getPaDataType() {
+        Integer value = getFieldAsInteger(PADATA_TYPE);
+        return PaDataType.fromValue(value);
+    }
+
+    public void setPaDataType(PaDataType paDataType) {
+        setFieldAsInt(PADATA_TYPE, paDataType.getValue());
+    }
+
+    public byte[] getPaDataValue() {
+        return getFieldAsOctets(PADATA_VALUE);
+    }
+
+    public void setPaDataValue(byte[] paDataValue) {
+        setFieldAsOctets(PADATA_VALUE, paDataValue);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataType.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataType.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataType.java
new file mode 100644
index 0000000..7938277
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaDataType.java
@@ -0,0 +1,92 @@
+/**
+ *  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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbEnum;
+
+/**
+ * From krb5.h
+ */
+public enum PaDataType implements KrbEnum {
+    NONE                (0),
+    TGS_REQ              (1),
+    AP_REQ              (1),
+    ENC_TIMESTAMP       (2), // RFC 4120
+    PW_SALT             (3), // RFC 4120
+    ENC_ENCKEY        (4),  // Key encrypted within itself
+    ENC_UNIX_TIME       (5),  // timestamp encrypted in key. RFC 4120
+    ENC_SANDIA_SECURID (6),  // SecurId passcode. RFC 4120
+    SESAME              (7),  // Sesame project. RFC 4120
+    OSF_DCE             (8),  // OSF DCE. RFC 4120
+    CYBERSAFE_SECUREID (9),  // Cybersafe. RFC 4120
+    AFS3_SALT           (10), // Cygnus. RFC 4120, 3961
+    ETYPE_INFO          (11), // Etype info for preauth. RFC 4120
+    SAM_CHALLENGE       (12), // SAM/OTP
+    SAM_RESPONSE        (13), // SAM/OTP
+    PK_AS_REQ           (16), // PKINIT. RFC 4556
+    PK_AS_REP           (17), // PKINIT. RFC 4556
+    ETYPE_INFO2         (19), // RFC 4120
+    USE_SPECIFIED_KVNO  (20), // RFC 4120
+    SVR_REFERRAL_INFO   (20), // Windows 2000 referrals. RFC 6820
+    SAM_REDIRECT        (21), // SAM/OTP. RFC 4120
+    GET_FROM_TYPED_DATA (22), // Embedded in typed data. RFC 4120
+    REFERRAL            (25), // draft referral system
+    SAM_CHALLENGE_2     (30), // draft challenge system, updated
+    SAM_RESPONSE_2      (31), // draft challenge system, updated
+    /* MS-KILE */
+    PAC_REQUEST         (128), // include Windows PAC
+    FOR_USER            (129), // username protocol transition request
+    S4U_X509_USER       (130), // certificate protocol transition request
+    AS_CHECKSUM         (132), // AS checksum
+    FX_COOKIE           (133), // RFC 6113
+    FX_FAST             (136), // RFC 6113
+    FX_ERROR            (137), // RFC 6113
+    ENCRYPTED_CHALLENGE (138), // RFC 6113
+    OTP_CHALLENGE       (141), // RFC 6560 section 4.1
+    OTP_REQUEST         (142), // RFC 6560 section 4.2
+    OTP_PIN_CHANGE      (144), // RFC 6560 section 4.3
+    PKINIT_KX           (147), // RFC 6112
+    ENCPADATA_REQ_ENC_PA_REP   (149), // RFC 6806
+    TOKEN_REQUEST       (148), // TokenPreauth
+    TOKEN_CHALLENGE     (149);
+
+    private final int value;
+
+    private PaDataType(int value) {
+        this.value = value;
+    }
+
+    @Override
+    public int getValue() {
+        return value;
+    }
+
+    public static PaDataType fromValue(Integer value) {
+        if (value != null) {
+            for (KrbEnum e : values()) {
+                if (e.getValue() == value.intValue()) {
+                    return (PaDataType) e;
+                }
+            }
+        }
+
+        return NONE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaEncTsEnc.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaEncTsEnc.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaEncTsEnc.java
new file mode 100644
index 0000000..b6407a8
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/PaEncTsEnc.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.kerberos.kerb.spec.pa;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-ENC-TS-ENC           ::= SEQUENCE {
+    patimestamp     [0] KerberosTime -- client's time --,
+    pausec          [1] Microseconds OPTIONAL
+ }
+ */
+public class PaEncTsEnc extends KrbSequenceType {
+    private static int PATIMESTAMP = 0;
+    private static int PAUSEC = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(PATIMESTAMP, 1, KerberosTime.class),
+            new Asn1FieldInfo(PAUSEC, 2, Asn1Integer.class)
+    };
+
+    public PaEncTsEnc() {
+        super(fieldInfos);
+    }
+
+    public KerberosTime getPaTimestamp() {
+        return getFieldAsTime(PATIMESTAMP);
+    }
+
+    public void setPaTimestamp(KerberosTime paTimestamp) {
+        setFieldAs(PATIMESTAMP, paTimestamp);
+    }
+
+    public int getPaUsec() {
+        return getFieldAsInt(PAUSEC);
+    }
+
+    public void setPaUsec(int paUsec) {
+        setFieldAsInt(PAUSEC, paUsec);
+    }
+
+    public KerberosTime getAllTime() {
+        KerberosTime paTimestamp = getPaTimestamp();
+        return paTimestamp.extend(getPaUsec() / 1000);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/OtpTokenInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/OtpTokenInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/OtpTokenInfo.java
new file mode 100644
index 0000000..b2f3340
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/OtpTokenInfo.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.kerberos.kerb.spec.pa.otp;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.Asn1Utf8String;
+import org.apache.kerby.kerberos.kerb.spec.KerberosString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.pa.pkinit.AlgorithmIdentifiers;
+
+/**
+ OTP-TOKENINFO ::= SEQUENCE {
+     flags            [0] OTPFlags,
+     otp-vendor       [1] UTF8String               OPTIONAL,
+     otp-challenge    [2] OCTET STRING (SIZE(1..MAX)) OPTIONAL,
+     otp-length       [3] Int32                    OPTIONAL,
+     otp-format       [4] OTPFormat                OPTIONAL,
+     otp-tokenID      [5] OCTET STRING             OPTIONAL,
+     otp-algID        [6] AnyURI                   OPTIONAL,
+     supportedHashAlg [7] SEQUENCE OF AlgorithmIdentifier OPTIONAL,
+     iterationCount   [8] Int32                    OPTIONAL
+ }
+ */
+public class OtpTokenInfo extends KrbSequenceType {
+    private static int FLAGS = 0;
+    private static int OTP_VENDOR = 1;
+    private static int OTP_CHALLENGE = 2;
+    private static int OTP_LENGTH = 3;
+    private static int OTP_FORMAT = 4;
+    private static int OTP_TOKEN_ID = 5;
+    private static int OTP_ALG_ID = 6;
+    private static int SUPPORTED_HASH_ALG = 7;
+    private static int ITERATION_COUNT = 8;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(FLAGS, Asn1OctetString.class, true),
+            new Asn1FieldInfo(OTP_VENDOR, Asn1Utf8String.class),
+            new Asn1FieldInfo(OTP_CHALLENGE, Asn1OctetString.class, true),
+            new Asn1FieldInfo(OTP_LENGTH, KerberosString.class),
+            new Asn1FieldInfo(OTP_FORMAT, Asn1OctetString.class, true),
+            new Asn1FieldInfo(OTP_TOKEN_ID, Asn1Utf8String.class),
+            new Asn1FieldInfo(OTP_ALG_ID, Asn1OctetString.class, true),
+            new Asn1FieldInfo(SUPPORTED_HASH_ALG, AlgorithmIdentifiers.class),
+            new Asn1FieldInfo(ITERATION_COUNT, Asn1Integer.class, true)
+    };
+
+    public OtpTokenInfo() {
+        super(fieldInfos);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/PaOtpChallenge.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/PaOtpChallenge.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/PaOtpChallenge.java
new file mode 100644
index 0000000..0266a99
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/otp/PaOtpChallenge.java
@@ -0,0 +1,55 @@
+/**
+ *  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.kerberos.kerb.spec.pa.otp;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.Asn1Utf8String;
+import org.apache.kerby.kerberos.kerb.spec.KerberosString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-OTP-CHALLENGE ::= SEQUENCE {
+     nonce            [0] OCTET STRING,
+     otp-service      [1] UTF8String               OPTIONAL,
+     otp-tokenInfo    [2] SEQUENCE (SIZE(1..MAX)) OF OTP-TOKENINFO,
+     salt             [3] KerberosString           OPTIONAL,
+     s2kparams        [4] OCTET STRING             OPTIONAL,
+ }
+ */
+public class PaOtpChallenge extends KrbSequenceType {
+    private static int NONCE = 0;
+    private static int OTP_SERVICE = 1;
+    private static int OTP_TOKEN_INFO = 2;
+    private static int SALT = 3;
+    private static int S2KPARAMS = 4;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(NONCE, Asn1OctetString.class, true),
+            new Asn1FieldInfo(OTP_SERVICE, Asn1Utf8String.class),
+            new Asn1FieldInfo(OTP_TOKEN_INFO, Asn1OctetString.class, true),
+            new Asn1FieldInfo(SALT, KerberosString.class),
+            new Asn1FieldInfo(S2KPARAMS, Asn1OctetString.class, true)
+    };
+
+    public PaOtpChallenge() {
+        super(fieldInfos);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AdInitialVerifiedCas.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AdInitialVerifiedCas.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AdInitialVerifiedCas.java
new file mode 100644
index 0000000..484f37b
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AdInitialVerifiedCas.java
@@ -0,0 +1,28 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+
+/**
+ * AD-INITIAL-VERIFIED-CAS ::= SEQUENCE OF ExternalPrincipalIdentifier
+ */
+public class AdInitialVerifiedCas extends KrbSequenceOfType<ExternalPrincipalIdentifier> {
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AlgorithmIdentifiers.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AlgorithmIdentifiers.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AlgorithmIdentifiers.java
new file mode 100644
index 0000000..2d1fa74
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AlgorithmIdentifiers.java
@@ -0,0 +1,30 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+import org.apache.kerby.kerberos.kerb.spec.x509.AlgorithmIdentifier;
+
+/**
+ trustedCertifiers       SEQUENCE OF AlgorithmIdentifier OPTIONAL,
+ */
+public class AlgorithmIdentifiers extends KrbSequenceOfType<AlgorithmIdentifier> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AuthPack.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AuthPack.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AuthPack.java
new file mode 100644
index 0000000..98757e8
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/AuthPack.java
@@ -0,0 +1,82 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.x509.SubjectPublicKeyInfo;
+
+/**
+ AuthPack ::= SEQUENCE {
+     pkAuthenticator         [0] PKAuthenticator,
+     clientPublicValue       [1] SubjectPublicKeyInfo OPTIONAL,
+     supportedCMSTypes       [2] SEQUENCE OF AlgorithmIdentifier OPTIONAL,
+     clientDHNonce           [3] DHNonce OPTIONAL
+ }
+ */
+public class AuthPack extends KrbSequenceType {
+    private static int PK_AUTHENTICATOR = 0;
+    private static int CLIENT_PUBLIC_VALUE = 1;
+    private static int SUPPORTED_CMS_TYPES = 2;
+    private static int CLIENT_DH_NONCE = 3;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(PK_AUTHENTICATOR, PkAuthenticator.class),
+            new Asn1FieldInfo(CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class),
+            new Asn1FieldInfo(SUPPORTED_CMS_TYPES, AlgorithmIdentifiers.class),
+            new Asn1FieldInfo(CLIENT_DH_NONCE, DHNonce.class)
+    };
+
+    public AuthPack() {
+        super(fieldInfos);
+    }
+
+    public PkAuthenticator getPkAuthenticator() {
+        return getFieldAs(PK_AUTHENTICATOR, PkAuthenticator.class);
+    }
+
+    public void setPkAuthenticator(PkAuthenticator pkAuthenticator) {
+        setFieldAs(PK_AUTHENTICATOR, pkAuthenticator);
+    }
+
+    public SubjectPublicKeyInfo getClientPublicValue() {
+        return getFieldAs(CLIENT_PUBLIC_VALUE, SubjectPublicKeyInfo.class);
+    }
+
+    public void setClientPublicValue(SubjectPublicKeyInfo clientPublicValue) {
+        setFieldAs(CLIENT_PUBLIC_VALUE, clientPublicValue);
+    }
+
+    public AlgorithmIdentifiers getsupportedCmsTypes() {
+        return getFieldAs(CLIENT_DH_NONCE, AlgorithmIdentifiers.class);
+    }
+
+    public void setsupportedCmsTypes(AlgorithmIdentifiers supportedCMSTypes) {
+        setFieldAs(CLIENT_DH_NONCE, supportedCMSTypes);
+    }
+
+    public DHNonce getClientDhNonce() {
+        return getFieldAs(CLIENT_DH_NONCE, DHNonce.class);
+    }
+
+    public void setClientDhNonce(DHNonce dhNonce) {
+        setFieldAs(CLIENT_DH_NONCE, dhNonce);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHNonce.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHNonce.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHNonce.java
new file mode 100644
index 0000000..4e51adb
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHNonce.java
@@ -0,0 +1,28 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1OctetString;
+
+/**
+ * DHNonce ::= OCTET STRING
+ */
+public class DHNonce extends Asn1OctetString {
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHRepInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHRepInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHRepInfo.java
new file mode 100644
index 0000000..9844615
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/DHRepInfo.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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ DHRepInfo ::= SEQUENCE {
+    dhSignedData            [0] IMPLICIT OCTET STRING,
+    serverDHNonce           [1] DHNonce OPTIONAL
+ }
+ */
+public class DHRepInfo extends KrbSequenceType {
+    private static int DH_SIGNED_DATA = 0;
+    private static int SERVER_DH_NONCE = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(DH_SIGNED_DATA, Asn1OctetString.class, true),
+            new Asn1FieldInfo(SERVER_DH_NONCE, DHNonce.class)
+    };
+
+    public DHRepInfo() {
+        super(fieldInfos);
+    }
+
+    public byte[] getDHSignedData() {
+        return getFieldAsOctets(DH_SIGNED_DATA);
+    }
+
+    public void setDHSignedData(byte[] dhSignedData) {
+        setFieldAsOctets(DH_SIGNED_DATA, dhSignedData);
+    }
+
+    public DHNonce getServerDhNonce() {
+        return getFieldAs(SERVER_DH_NONCE, DHNonce.class);
+    }
+
+    public void setServerDhNonce(DHNonce dhNonce) {
+        setFieldAs(SERVER_DH_NONCE, dhNonce);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ExternalPrincipalIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ExternalPrincipalIdentifier.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ExternalPrincipalIdentifier.java
new file mode 100644
index 0000000..4a67feb
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ExternalPrincipalIdentifier.java
@@ -0,0 +1,71 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ ExternalPrincipalIdentifier ::= SEQUENCE {
+     subjectName             [0] IMPLICIT OCTET STRING OPTIONAL,
+     issuerAndSerialNumber   [1] IMPLICIT OCTET STRING OPTIONAL,
+     subjectKeyIdentifier    [2] IMPLICIT OCTET STRING OPTIONAL
+ }
+ */
+public class ExternalPrincipalIdentifier extends KrbSequenceType {
+    private static int SUBJECT_NAME = 0;
+    private static int ISSUER_AND_SERIAL_NUMBER = 1;
+    private static int SUBJECT_KEY_IDENTIFIER = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(SUBJECT_NAME, Asn1OctetString.class, true),
+            new Asn1FieldInfo(ISSUER_AND_SERIAL_NUMBER, Asn1OctetString.class, true),
+            new Asn1FieldInfo(SUBJECT_KEY_IDENTIFIER, Asn1OctetString.class, true)
+    };
+
+    public ExternalPrincipalIdentifier() {
+        super(fieldInfos);
+    }
+
+    public byte[] getSubjectName() {
+        return getFieldAsOctets(SUBJECT_NAME);
+    }
+
+    public void setSubjectName(byte[] subjectName) {
+        setFieldAsOctets(SUBJECT_NAME, subjectName);
+    }
+
+    public byte[] getIssuerSerialNumber() {
+        return getFieldAsOctets(ISSUER_AND_SERIAL_NUMBER);
+    }
+
+    public void setIssuerSerialNumber(byte[] issuerSerialNumber) {
+        setFieldAsOctets(ISSUER_AND_SERIAL_NUMBER, issuerSerialNumber);
+    }
+
+    public byte[] getSubjectKeyIdentifier() {
+        return getFieldAsOctets(SUBJECT_KEY_IDENTIFIER);
+    }
+
+    public void setSubjectKeyIdentifier(byte[] subjectKeyIdentifier) {
+        setFieldAsOctets(SUBJECT_KEY_IDENTIFIER, subjectKeyIdentifier);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/KdcDHKeyInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/KdcDHKeyInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/KdcDHKeyInfo.java
new file mode 100644
index 0000000..97c6003
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/KdcDHKeyInfo.java
@@ -0,0 +1,65 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+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.kerberos.kerb.spec.KerberosTime;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ KDCDHKeyInfo ::= SEQUENCE {
+    subjectPublicKey        [0] BIT STRING,
+    nonce                   [1] INTEGER (0..4294967295),
+    dhKeyExpiration         [2] KerberosTime OPTIONAL,
+ }
+ */
+public class KdcDHKeyInfo extends KrbSequenceType {
+    private static int SUBJECT_PUBLICK_KEY = 0;
+    private static int NONCE = 1;
+    private static int DH_KEY_EXPIRATION = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(SUBJECT_PUBLICK_KEY, Asn1BitString.class),
+            new Asn1FieldInfo(NONCE, Asn1Integer.class),
+            new Asn1FieldInfo(DH_KEY_EXPIRATION, KerberosTime.class)
+    };
+
+    public KdcDHKeyInfo() {
+        super(fieldInfos);
+    }
+
+    public byte[] getSubjectPublicKey() {
+        return getFieldAsOctets(SUBJECT_PUBLICK_KEY);
+    }
+
+    public void setSubjectPublicKey(byte[] subjectPublicKey) {
+        setFieldAsOctets(SUBJECT_PUBLICK_KEY, subjectPublicKey);
+    }
+
+    public int getNonce() {
+        return getFieldAsInt(NONCE);
+    }
+
+    public void setNonce(int nonce) {
+        setFieldAsInt(NONCE, nonce);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/Krb5PrincipalName.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/Krb5PrincipalName.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/Krb5PrincipalName.java
new file mode 100644
index 0000000..543b7c8
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/Krb5PrincipalName.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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.common.PrincipalName;
+import org.apache.kerby.kerberos.kerb.spec.common.Realm;
+
+/**
+ KRB5PrincipalName ::= SEQUENCE {
+     realm                   [0] Realm,
+     principalName           [1] PrincipalName
+ }
+ */
+public class Krb5PrincipalName extends KrbSequenceType {
+    private static int REALM = 0;
+    private static int PRINCIPAL_NAME = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(REALM, Realm.class),
+            new Asn1FieldInfo(PRINCIPAL_NAME, PrincipalName.class)
+    };
+
+    public Krb5PrincipalName() {
+        super(fieldInfos);
+    }
+
+    public String getRelm() {
+        return getFieldAsString(REALM);
+    }
+
+    public void setRealm(String realm) {
+        setFieldAsString(REALM, realm);
+    }
+
+    public PrincipalName getPrincipalName() {
+        return getFieldAs(PRINCIPAL_NAME, PrincipalName.class);
+    }
+
+    public void setPrincipalName(PrincipalName principalName) {
+        setFieldAs(PRINCIPAL_NAME, principalName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsRep.java
new file mode 100644
index 0000000..952bea6
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsRep.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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1Choice;
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+
+/**
+ PA-PK-AS-REP ::= CHOICE {
+    dhInfo                  [0] DHRepInfo,
+    encKeyPack              [1] IMPLICIT OCTET STRING,
+ }
+ */
+public class PaPkAsRep extends Asn1Choice {
+    private static int DH_INFO = 0;
+    private static int ENCKEY_PACK = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(DH_INFO, DHRepInfo.class),
+            new Asn1FieldInfo(ENCKEY_PACK, Asn1OctetString.class, true)
+    };
+
+    public PaPkAsRep() {
+        super(fieldInfos);
+    }
+
+    public DHRepInfo getDHRepInfo() {
+        return getFieldAs(DH_INFO, DHRepInfo.class);
+    }
+
+    public void setDHRepInfo(DHRepInfo dhRepInfo) {
+        setFieldAs(DH_INFO, dhRepInfo);
+    }
+
+    public byte[] getEncKeyPack() {
+        return getFieldAsOctets(ENCKEY_PACK);
+    }
+
+    public void setEncKeyPack(byte[] encKeyPack) {
+        setFieldAsOctets(ENCKEY_PACK, encKeyPack);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsReq.java
new file mode 100644
index 0000000..79e6e55
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PaPkAsReq.java
@@ -0,0 +1,71 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-PK-AS-REQ ::= SEQUENCE {
+     signedAuthPack          [0] IMPLICIT OCTET STRING,
+     trustedCertifiers       [1] SEQUENCE OF ExternalPrincipalIdentifier OPTIONAL,
+     kdcPkId                 [2] IMPLICIT OCTET STRING OPTIONAL
+ }
+ */
+public class PaPkAsReq extends KrbSequenceType {
+    private static int SIGNED_AUTH_PACK = 0;
+    private static int TRUSTED_CERTIFIERS = 1;
+    private static int KDC_PKID = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(SIGNED_AUTH_PACK, Asn1OctetString.class, true),
+            new Asn1FieldInfo(TRUSTED_CERTIFIERS, TrustedCertifiers.class),
+            new Asn1FieldInfo(KDC_PKID, Asn1OctetString.class, true)
+    };
+
+    public PaPkAsReq() {
+        super(fieldInfos);
+    }
+
+    public byte[] getSignedAuthPack() {
+        return getFieldAsOctets(SIGNED_AUTH_PACK);
+    }
+
+    public void setSignedAuthPack(byte[] signedAuthPack) {
+        setFieldAsOctets(SIGNED_AUTH_PACK, signedAuthPack);
+    }
+
+    public TrustedCertifiers getTrustedCertifiers() {
+        return getFieldAs(TRUSTED_CERTIFIERS, TrustedCertifiers.class);
+    }
+
+    public void setTrustedCertifiers(TrustedCertifiers trustedCertifiers) {
+        setFieldAs(TRUSTED_CERTIFIERS, trustedCertifiers);
+    }
+
+    public byte[] getKdcPkId() {
+        return getFieldAsOctets(KDC_PKID);
+    }
+
+    public void setKdcPkId(byte[] kdcPkId) {
+        setFieldAsOctets(KDC_PKID, kdcPkId);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PkAuthenticator.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PkAuthenticator.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PkAuthenticator.java
new file mode 100644
index 0000000..d1fafd7
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/PkAuthenticator.java
@@ -0,0 +1,91 @@
+/**
+ *  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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PKAuthenticator ::= SEQUENCE {
+     cusec                   [0] INTEGER (0..999999),
+     ctime                   [1] KerberosTime,
+     -- cusec and ctime are used as in [RFC4120], for
+     -- replay prevention.
+     nonce                   [2] INTEGER (0..4294967295),
+     -- Chosen randomly; this nonce does not need to
+     -- match with the nonce in the KDC-REQ-BODY.
+     paChecksum              [3] OCTET STRING OPTIONAL,
+     -- MUST be present.
+     -- Contains the SHA1 checksum, performed over
+     -- KDC-REQ-BODY.
+ }
+ */
+public class PkAuthenticator extends KrbSequenceType {
+    private static int CUSEC = 0;
+    private static int CTIME = 1;
+    private static int NONCE = 2;
+    private static int PA_CHECKSUM = 3;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(CUSEC, Asn1Integer.class),
+            new Asn1FieldInfo(CTIME, KerberosTime.class),
+            new Asn1FieldInfo(NONCE, Asn1Integer.class),
+            new Asn1FieldInfo(PA_CHECKSUM, Asn1OctetString.class)
+    };
+
+    public PkAuthenticator() {
+        super(fieldInfos);
+    }
+
+    public int getCusec() {
+        return getFieldAsInt(CUSEC);
+    }
+
+    public void setCusec(int cusec) {
+        setFieldAsInt(CUSEC, cusec);
+    }
+
+    public KerberosTime getCtime() {
+        return getFieldAsTime(CTIME);
+    }
+
+    public void setCtime(KerberosTime ctime) {
+        setFieldAs(CTIME, ctime);
+    }
+
+    public int getNonce() {
+        return getFieldAsInt(NONCE);
+    }
+
+    public void setNonce(int nonce) {
+        setFieldAsInt(NONCE, nonce);
+    }
+
+    public byte[] getPaChecksum() {
+        return getFieldAsOctets(PA_CHECKSUM);
+    }
+
+    public void setPaChecksum(byte[] paChecksum) {
+        setFieldAsOctets(PA_CHECKSUM, paChecksum);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ReplyKeyPack.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ReplyKeyPack.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ReplyKeyPack.java
new file mode 100644
index 0000000..af0dfc3
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/ReplyKeyPack.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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.common.CheckSum;
+import org.apache.kerby.kerberos.kerb.spec.common.EncryptionKey;
+
+/**
+ ReplyKeyPack ::= SEQUENCE {
+    replyKey                [0] EncryptionKey,
+    asChecksum              [1] Checksum,
+ }
+ */
+public class ReplyKeyPack extends KrbSequenceType {
+    private static int REPLY_KEY = 0;
+    private static int AS_CHECKSUM = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(REPLY_KEY, EncryptionKey.class),
+            new Asn1FieldInfo(AS_CHECKSUM, CheckSum.class)
+    };
+
+    public ReplyKeyPack() {
+        super(fieldInfos);
+    }
+
+    public EncryptionKey getReplyKey() {
+        return getFieldAs(REPLY_KEY, EncryptionKey.class);
+    }
+
+    public void setReplyKey(EncryptionKey replyKey) {
+        setFieldAs(REPLY_KEY, replyKey);
+    }
+
+    public CheckSum getAsChecksum() {
+        return getFieldAs(AS_CHECKSUM, CheckSum.class);
+    }
+
+    public void setAsChecksum(CheckSum checkSum) {
+        setFieldAs(AS_CHECKSUM, checkSum);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TdDhParameters.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TdDhParameters.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TdDhParameters.java
new file mode 100644
index 0000000..77e82b1
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TdDhParameters.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.kerberos.kerb.spec.pa.pkinit;
+
+/**
+ * TD-DH-PARAMETERS ::= SEQUENCE OF AlgorithmIdentifier
+ */
+public class TdDhParameters extends AlgorithmIdentifiers {
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TrustedCertifiers.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TrustedCertifiers.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TrustedCertifiers.java
new file mode 100644
index 0000000..418b213
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/pkinit/TrustedCertifiers.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.kerberos.kerb.spec.pa.pkinit;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+
+/**
+ trustedCertifiers       SEQUENCE OF ExternalPrincipalIdentifier OPTIONAL,
+ */
+public class TrustedCertifiers extends KrbSequenceOfType<ExternalPrincipalIdentifier> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenChallenge.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenChallenge.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenChallenge.java
new file mode 100644
index 0000000..5956fc7
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenChallenge.java
@@ -0,0 +1,40 @@
+/**
+ *  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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ PA-TOKEN-CHALLENGE ::= SEQUENCE {
+    tokenInfos       [0] SEQUENCE (SIZE(1..MAX)) OF TokenInfo,
+ }
+*/
+public class PaTokenChallenge extends KrbSequenceType {
+    private static int TOKENINFOS = 0;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(TOKENINFOS, TokenInfos.class)
+    };
+
+    public PaTokenChallenge() {
+        super(fieldInfos);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenRequest.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenRequest.java
new file mode 100644
index 0000000..6b08a6f
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/PaTokenRequest.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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+import org.apache.kerby.kerberos.kerb.spec.common.KrbToken;
+
+/**
+ PA-TOKEN-REQUEST ::= SEQUENCE {
+    token          [0]  OCTET STRING,
+    tokenInfo      [1]  TokenInfo
+ }
+*/
+public class PaTokenRequest extends KrbSequenceType {
+    private static int TOKEN_INFO = 0;
+    private static int TOKEN = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(TOKEN_INFO, TokenInfo.class),
+            new Asn1FieldInfo(TOKEN, KrbToken.class)
+    };
+
+    public PaTokenRequest() {
+        super(fieldInfos);
+    }
+
+    public KrbToken getToken() {
+        return getFieldAs(TOKEN, KrbToken.class);
+    }
+
+    public void setToken(KrbToken token) {
+        setFieldAs(TOKEN, token);
+    }
+
+    public String getTokenInfo() {
+        return getFieldAsString(TOKEN_INFO);
+    }
+
+    public void setTokenInfo(TokenInfo tokenInfo) {
+        setFieldAs(TOKEN_INFO, tokenInfo);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlag.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlag.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlag.java
new file mode 100644
index 0000000..75f06f6
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlag.java
@@ -0,0 +1,51 @@
+/**
+ *  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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbEnum;
+
+public enum TokenFlag implements KrbEnum {
+    NONE(-1),
+    ID_TOKEN_REQUIRED(0x40000000),
+    AC_TOKEN_REQUIRED(0x20000000),
+    BEARER_TOKEN_REQUIRED(0x10000000),
+    HOK_TOKEN_REQUIRED(0x08000000);
+
+    private final int value;
+
+    private TokenFlag(int value) {
+        this.value = value;
+    }
+
+    @Override
+    public int getValue() {
+        return value;
+    }
+
+    public static TokenFlag fromValue(int value) {
+        for (KrbEnum e : values()) {
+            if (e.getValue() == value) {
+                return (TokenFlag) e;
+            }
+        }
+
+        return NONE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlags.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlags.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlags.java
new file mode 100644
index 0000000..af6e0f9
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenFlags.java
@@ -0,0 +1,39 @@
+/**
+ *  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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.kerberos.kerb.spec.common.KrbFlags;
+
+import static org.apache.kerby.kerberos.kerb.spec.ticket.TicketFlag.INVALID;
+
+public class TokenFlags extends KrbFlags {
+
+    public TokenFlags() {
+        this(0);
+    }
+
+    public TokenFlags(int value) {
+        setFlags(value);
+    }
+
+    public boolean isInvalid() {
+        return isFlagSet(INVALID.getValue());
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfo.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfo.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfo.java
new file mode 100644
index 0000000..43533ca
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfo.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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1OctetString;
+import org.apache.kerby.asn1.type.Asn1Utf8String;
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceType;
+
+/**
+ TokenInfo ::= SEQUENCE {
+    flags            [0] TokenFlags,
+    tokenVendor      [1] UTF8String,
+ }
+ */
+public class TokenInfo extends KrbSequenceType {
+    private static int FLAGS = 0;
+    private static int TOKEN_VENDOR = 1;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(FLAGS, Asn1OctetString.class, true),
+            new Asn1FieldInfo(TOKEN_VENDOR, Asn1Utf8String.class),
+    };
+
+    public TokenInfo() {
+        super(fieldInfos);
+    }
+
+    public TokenFlags getFlags() {
+        return getFieldAs(FLAGS, TokenFlags.class);
+    }
+
+    public void setFlags(TokenFlags flags) {
+        setFieldAs(FLAGS, flags);
+    }
+
+    public String getTokenVendor() {
+        return getFieldAsString(TOKEN_VENDOR);
+    }
+
+    public void setTokenVendor(String tokenVendor) {
+        setFieldAs(TOKEN_VENDOR, new Asn1Utf8String(tokenVendor));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfos.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfos.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfos.java
new file mode 100644
index 0000000..85d6e58
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/pa/token/TokenInfos.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.kerberos.kerb.spec.pa.token;
+
+import org.apache.kerby.kerberos.kerb.spec.KrbSequenceOfType;
+
+/**
+ SEQUENCE (SIZE(1..MAX)) OF TokenInfo,
+*/
+public class TokenInfos extends KrbSequenceOfType<TokenInfo> {
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/7d9261af/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/ticket/AbstractServiceTicket.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/ticket/AbstractServiceTicket.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/ticket/AbstractServiceTicket.java
new file mode 100644
index 0000000..28f5dea
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/ticket/AbstractServiceTicket.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.kerberos.kerb.spec.ticket;
+
+import org.apache.kerby.kerberos.kerb.spec.common.EncryptionKey;
+import org.apache.kerby.kerberos.kerb.spec.kdc.EncKdcRepPart;
+
+public class AbstractServiceTicket {
+    private Ticket ticket;
+    private EncKdcRepPart encKdcRepPart;
+
+    public AbstractServiceTicket(Ticket ticket, EncKdcRepPart encKdcRepPart) {
+        this.ticket = ticket;
+        this.encKdcRepPart = encKdcRepPart;
+    }
+
+    public Ticket getTicket() {
+        return ticket;
+    }
+
+    public EncKdcRepPart getEncKdcRepPart() {
+        return encKdcRepPart;
+    }
+
+    public EncryptionKey getSessionKey() {
+        return encKdcRepPart.getKey();
+    }
+
+    public String getRealm() {
+        return ticket.getRealm();
+    }
+}