directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [1/2] directory-kerby git commit: The test files were misplaced
Date Thu, 17 Dec 2015 05:14:41 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 178c32535 -> 174880304


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
new file mode 100644
index 0000000..acac897
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
@@ -0,0 +1,117 @@
+/**
+ *  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.codec;
+
+import org.apache.kerby.cms.type.ContentInfo;
+import org.apache.kerby.cms.type.EncapsulatedContentInfo;
+import org.apache.kerby.cms.type.SignedData;
+import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsRep;
+import org.apache.kerby.kerberos.kerb.type.pa.PaData;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHRepInfo;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDHKeyInfo;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsRep;
+import org.apache.kerby.kerberos.kerb.type.ticket.Ticket;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitAnonymousAsRepCodec {
+    @Test
+    public void test() throws IOException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_anonymous_asrep.token");
+        ByteBuffer asRepToken = ByteBuffer.wrap(bytes);
+
+        AsRep asRep = new AsRep();
+        asRep.decode(asRepToken);
+
+        assertThat(asRep.getPvno()).isEqualTo(5);
+        assertThat(asRep.getMsgType()).isEqualTo(KrbMessageType.AS_REP);
+        PaData paData = asRep.getPaData();
+
+        PaDataEntry pkAsRepEntry = paData.findEntry(PaDataType.PK_AS_REP);
+        assertThat(pkAsRepEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REP);
+
+        PaPkAsRep paPkAsRep = new PaPkAsRep();
+        byte[] padataValue = pkAsRepEntry.getPaDataValue();
+//        Asn1.dump(padataValue, true);
+        paPkAsRep.decode(padataValue);
+
+        assertThat(paPkAsRep.getDHRepInfo()).isNotNull();
+
+        DHRepInfo dhRepInfo = paPkAsRep.getDHRepInfo();
+        byte[] dhSignedData = dhRepInfo.getDHSignedData();
+        ContentInfo contentInfo = new ContentInfo();
+        contentInfo.decode(dhSignedData);
+        assertThat(contentInfo.getContentType().getValue()).isEqualTo("1.2.840.113549.1.7.2");
+        SignedData signedData = contentInfo.getContentAs(SignedData.class);
+        assertThat(signedData.getCertificates()).isNotNull();
+
+        EncapsulatedContentInfo encapsulatedContentInfo = signedData.getEncapContentInfo();
+        assertThat(encapsulatedContentInfo.getContentType().getValue()).isEqualTo("1.3.6.1.5.2.3.2");
+
+        byte[] eContentInfo = encapsulatedContentInfo.getContent();
+        KdcDHKeyInfo kdcDhKeyInfo = new KdcDHKeyInfo();
+        kdcDhKeyInfo.decode(eContentInfo);
+        assertThat(kdcDhKeyInfo.getSubjectPublicKey()).isNotNull();
+        assertThat(kdcDhKeyInfo.getDHKeyExpiration()).isNotNull();
+        assertThat(kdcDhKeyInfo.getNonce()).isNotNull();
+
+        PaDataEntry etypeInfo2Entry = paData.findEntry(PaDataType.ETYPE_INFO2);
+        assertThat(etypeInfo2Entry.getPaDataType()).isEqualTo(PaDataType.ETYPE_INFO2);
+
+        PaDataEntry pkinitKxEntry = paData.findEntry(PaDataType.PKINIT_KX);
+        assertThat(pkinitKxEntry.getPaDataType()).isEqualTo(PaDataType.PKINIT_KX);
+
+        assertThat(asRep.getPvno()).isEqualTo(5);
+        assertThat(asRep.getMsgType()).isEqualTo(KrbMessageType.AS_REP);
+        assertThat(asRep.getCrealm()).isEqualTo("WELLKNOWN:ANONYMOUS");
+
+        PrincipalName cName = asRep.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_WELLKNOWN);
+        assertThat(cName.getNameStrings()).hasSize(2).contains("WELLKNOWN", "ANONYMOUS");
+
+        Ticket ticket = asRep.getTicket();
+        assertThat(ticket.getTktvno()).isEqualTo(5);
+        assertThat(ticket.getRealm()).isEqualTo("EXAMPLE.COM");
+        PrincipalName sName = ticket.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_INST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("krbtgt", "EXAMPLE.COM");
+
+        EncryptedData encryptedData = ticket.getEncryptedEncPart();
+        assertThat(encryptedData.getKvno()).isEqualTo(1);
+        assertThat(encryptedData.getEType().getValue()).isEqualTo(0x0012);
+
+        // Test encode PaPkAsRep
+        //TO BE FIXED
+//        byte[] encodedPaPkAsRep = paPkAsRep.encode();
+//        PaPkAsRep decodedPaPkAsReq = new PaPkAsRep();
+//        decodedPaPkAsReq.decode(encodedPaPkAsRep);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
new file mode 100644
index 0000000..8f988f8
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
@@ -0,0 +1,114 @@
+/**
+ *  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.codec;
+
+import org.apache.kerby.asn1.Asn1;
+import org.apache.kerby.cms.type.ContentInfo;
+import org.apache.kerby.cms.type.SignedData;
+import org.apache.kerby.kerberos.kerb.type.base.EncryptionType;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsReq;
+import org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody;
+import org.apache.kerby.kerberos.kerb.type.pa.PaData;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitAnonymousAsReqCodec {
+    @Test
+    public void test() throws IOException, ParseException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_anonymous_asreq.token");
+        //Asn1.dump(bytes, true);
+        ByteBuffer asReqToken = ByteBuffer.wrap(bytes);
+
+        AsReq asReq = new AsReq();
+        asReq.decode(asReqToken);
+        //Asn1.dump(asReq, false);
+
+        assertThat(asReq.getPvno()).isEqualTo(5);
+        assertThat(asReq.getMsgType()).isEqualTo(KrbMessageType.AS_REQ);
+
+        PaData paData = asReq.getPaData();
+
+        PaDataEntry paFxCookieEntry = paData.findEntry(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataType()).isEqualTo(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 38, 41));
+
+        PaDataEntry pkAsReqEntry = paData.findEntry(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 58, 1366));
+
+        PaPkAsReq paPkAsReq = new PaPkAsReq();
+        paPkAsReq.decode(pkAsReqEntry.getPaDataValue());
+        ContentInfo contentInfo = new ContentInfo();
+        Asn1.parseAndDump(paPkAsReq.getSignedAuthPack());
+        contentInfo.decode(paPkAsReq.getSignedAuthPack());
+        assertThat(contentInfo.getContentType().getValue()).isEqualTo("1.2.840.113549.1.7.2");
+        Asn1.dump(contentInfo);
+
+        SignedData signedData = contentInfo.getContentAs(SignedData.class);
+        assertThat(signedData.getCertificates().getElements().isEmpty()).isEqualTo(true);
+        assertThat(signedData.getEncapContentInfo().getContentType().getValue()).isEqualTo("1.3.6.1.5.2.3.1");
+
+        PaDataEntry encpaEntry = paData.findEntry(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataType()).isEqualTo(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 1376, 1376));
+
+        KdcReqBody body = asReq.getReqBody();
+        assertThat(body.getKdcOptions().getPadding()).isEqualTo(0);
+        assertThat(body.getKdcOptions().getValue()).isEqualTo(Arrays.copyOfRange(bytes, 1389, 1393));
+        PrincipalName cName = body.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_WELLKNOWN);
+        assertThat(cName.getName()).isEqualTo("WELLKNOWN/ANONYMOUS");
+        assertThat(body.getRealm()).isEqualTo("EXAMPLE.COM");
+        PrincipalName sName = body.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_INST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("krbtgt", "EXAMPLE.COM");
+
+        assertThat(body.getNonce()).isEqualTo(1797404543);
+
+        List<EncryptionType> types = body.getEtypes();
+        assertThat(types).hasSize(6);
+        assertThat(types.get(0).getValue()).isEqualTo(0x0012);
+        assertThat(types.get(1).getValue()).isEqualTo(0x0011);
+        assertThat(types.get(2).getValue()).isEqualTo(0x0010);
+        assertThat(types.get(3).getValue()).isEqualTo(0x0017);
+        assertThat(types.get(4).getValue()).isEqualTo(0x0019);
+        assertThat(types.get(5).getValue()).isEqualTo(0x001A);
+
+        // Test encode PaPkAsReq
+        //TO BE FIXED
+//        byte[] encodedPaPkAsReq = paPkAsReq.encode();
+//        PaPkAsReq decodedPaPkAsReq = new PaPkAsReq();
+//        decodedPaPkAsReq.decode(encodedPaPkAsReq);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsRepCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsRepCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsRepCodec.java
new file mode 100644
index 0000000..94b0d1d
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsRepCodec.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.codec;
+
+import org.apache.kerby.cms.type.ContentInfo;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsRep;
+import org.apache.kerby.kerberos.kerb.type.pa.PaData;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsRep;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitRsaAsRepCodec {
+    @Test
+    public void test() throws IOException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_rsa_asrep.token");
+        ByteBuffer asRepToken = ByteBuffer.wrap(bytes);
+
+        AsRep asRep = new AsRep();
+        asRep.decode(asRepToken);
+
+        assertThat(asRep.getPvno()).isEqualTo(5);
+        assertThat(asRep.getMsgType()).isEqualTo(KrbMessageType.AS_REP);
+        PaData paData = asRep.getPaData();
+
+        PaDataEntry pkAsRepEntry = paData.findEntry(PaDataType.PK_AS_REP);
+        assertThat(pkAsRepEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REP);
+
+        PaPkAsRep paPkAsRep = new PaPkAsRep();
+        byte[] padataValue = pkAsRepEntry.getPaDataValue();
+        paPkAsRep.decode(padataValue);
+
+        assertThat(paPkAsRep.getEncKeyPack()).isNotNull();
+
+        byte[] encKeyPack = paPkAsRep.getEncKeyPack();
+
+        ContentInfo contentInfo = new ContentInfo();
+        contentInfo.decode(encKeyPack);
+        assertThat(contentInfo.getContentType().getValue()).isEqualTo("1.2.840.113549.1.7.3");
+//        EnvelopedData envelopedData = contentInfo.getContentAs(EnvelopedData.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsReqCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsReqCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsReqCodec.java
new file mode 100644
index 0000000..2f22d39
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitRsaAsReqCodec.java
@@ -0,0 +1,113 @@
+/**
+ *  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.codec;
+
+import org.apache.kerby.asn1.Asn1;
+import org.apache.kerby.cms.type.ContentInfo;
+import org.apache.kerby.cms.type.SignedData;
+import org.apache.kerby.kerberos.kerb.type.base.EncryptionType;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsReq;
+import org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody;
+import org.apache.kerby.kerberos.kerb.type.pa.PaData;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
+import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitRsaAsReqCodec {
+    @Test
+    public void test() throws IOException, ParseException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_rsa_asreq.token");
+        Asn1.parseAndDump(bytes);
+        ByteBuffer asReqToken = ByteBuffer.wrap(bytes);
+
+        AsReq asReq = new AsReq();
+        asReq.decode(asReqToken);
+        //Asn1.decodeAndDump(asReq);
+
+        assertThat(asReq.getPvno()).isEqualTo(5);
+        assertThat(asReq.getMsgType()).isEqualTo(KrbMessageType.AS_REQ);
+
+        PaData paData = asReq.getPaData();
+
+        PaDataEntry paFxCookieEntry = paData.findEntry(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataType()).isEqualTo(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 38, 41));
+
+        PaDataEntry pkAsReqEntry = paData.findEntry(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 58, 2138));
+
+        PaPkAsReq paPkAsReq = new PaPkAsReq();
+        paPkAsReq.decode(pkAsReqEntry.getPaDataValue());
+        ContentInfo contentInfo = new ContentInfo();
+//        Asn1.dump(paPkAsReq.getSignedAuthPack(), true);
+        contentInfo.decode(paPkAsReq.getSignedAuthPack());
+        assertThat(contentInfo.getContentType().getValue()).isEqualTo("1.2.840.113549.1.7.2");
+//        Asn1.dump(contentInfo);
+
+        SignedData signedData = contentInfo.getContentAs(SignedData.class);
+        assertThat(signedData.getCertificates().getElements().size()).isEqualTo(1);
+        assertThat(signedData.getEncapContentInfo().getContentType().getValue()).isEqualTo("1.3.6.1.5.2.3.1");
+
+        PaDataEntry encpaEntry = paData.findEntry(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataType()).isEqualTo(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 2148, 2148));
+
+        KdcReqBody body = asReq.getReqBody();
+        assertThat(body.getKdcOptions().getPadding()).isEqualTo(0);
+        assertThat(body.getKdcOptions().getValue()).isEqualTo(Arrays.copyOfRange(bytes, 2161, 2165));
+        PrincipalName cName = body.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_PRINCIPAL);
+        assertThat(body.getRealm()).isEqualTo("EXAMPLE.COM");
+        PrincipalName sName = body.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_INST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("krbtgt", "EXAMPLE.COM");
+
+        assertThat(body.getNonce()).isEqualTo(658979657);
+
+        List<EncryptionType> types = body.getEtypes();
+        assertThat(types).hasSize(6);
+        assertThat(types.get(0).getValue()).isEqualTo(0x0012);
+        assertThat(types.get(1).getValue()).isEqualTo(0x0011);
+        assertThat(types.get(2).getValue()).isEqualTo(0x0010);
+        assertThat(types.get(3).getValue()).isEqualTo(0x0017);
+        assertThat(types.get(4).getValue()).isEqualTo(0x0019);
+        assertThat(types.get(5).getValue()).isEqualTo(0x001A);
+
+        // Test encode PaPkAsReq
+        //TO BE FIXED
+//        byte[] encodedPaPkAsReq = paPkAsReq.encode();
+//        PaPkAsReq decodedPaPkAsReq = new PaPkAsReq();
+//        decodedPaPkAsReq.decode(encodedPaPkAsReq);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsRepCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsRepCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsRepCodec.java
new file mode 100644
index 0000000..48aa83f
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsRepCodec.java
@@ -0,0 +1,68 @@
+/**
+ *  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.codec;
+
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.TgsRep;
+import org.apache.kerby.kerberos.kerb.type.ticket.Ticket;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Test TgsRep message using a real 'correct' network packet captured from MS-AD to detective programming errors
+ * and compatibility issues particularly regarding Kerberos crypto.
+ */
+public class TestTgsRepCodec {
+
+    @Test
+    public void test() throws IOException {
+        byte[] bytes = CodecTestUtil.readBinaryFile("/tgsrep.token");
+        TgsRep tgsRep = new TgsRep();
+        tgsRep.decode(bytes);
+
+        assertThat(tgsRep.getPvno()).isEqualTo(5);
+        assertThat(tgsRep.getMsgType()).isEqualTo(KrbMessageType.TGS_REP);
+        assertThat(tgsRep.getCrealm()).isEqualTo("DENYDC.COM");
+
+        PrincipalName cName = tgsRep.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_PRINCIPAL);
+        assertThat(cName.getNameStrings()).hasSize(1).contains("des");
+
+        Ticket ticket = tgsRep.getTicket();
+        assertThat(ticket.getTktvno()).isEqualTo(5);
+        assertThat(ticket.getRealm()).isEqualTo("DENYDC.COM");
+        PrincipalName sName = ticket.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_HST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("host", "xp1.denydc.com");
+        //FIXME
+        //EncTicketPart encTicketPart = ticket.getEncPart();
+        //assertThat(encTicketPart.getKey().getKeyType().getValue()).isEqualTo(23);
+        //assertThat(encTicketPart.getKey().getKvno()).isEqualTo(2);
+
+        //EncKdcRepPart encKdcRepPart = tgsRep.getEncPart();
+        //assertThat(encKdcRepPart.getKey().getKeyType().getValue()).isEqualTo(3);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsReqCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsReqCodec.java b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsReqCodec.java
new file mode 100644
index 0000000..10dca95
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/java/org/apache/kerby/kerberos/kerb/codec/TestTgsReqCodec.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.codec;
+
+import org.apache.kerby.kerberos.kerb.type.base.EncryptionType;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody;
+import org.apache.kerby.kerberos.kerb.type.kdc.TgsReq;
+import org.apache.kerby.kerberos.kerb.type.pa.PaData;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
+import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.SimpleTimeZone;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Test TgsReq message using a real 'correct' network packet captured from MS-AD to detective programming errors
+ * and compatibility issues particularly regarding Kerberos crypto.
+ */
+public class TestTgsReqCodec {
+
+    @Test
+    public void test() throws IOException, ParseException {
+        byte[] bytes = CodecTestUtil.readBinaryFile("/tgsreq.token");
+        TgsReq tgsReq = new TgsReq();
+        tgsReq.decode(bytes);
+
+        assertThat(tgsReq.getPvno()).isEqualTo(5);
+        assertThat(tgsReq.getMsgType()).isEqualTo(KrbMessageType.TGS_REQ);
+
+        PaData paData = tgsReq.getPaData();
+        assertThat(paData.getElements()).hasSize(1);
+        PaDataEntry entry = paData.getElements().iterator().next();
+        assertThat(entry.getPaDataType()).isEqualTo(PaDataType.TGS_REQ);
+
+        //request body
+        KdcReqBody body = tgsReq.getReqBody();
+        assertThat(body.getKdcOptions().getPadding()).isEqualTo(0);
+        byte[] kdcOptionsValue = {64, (byte) 128, 0, 0};
+        assertThat(body.getKdcOptions().getValue()).isEqualTo(kdcOptionsValue);
+
+        assertThat(body.getRealm()).isEqualTo("DENYDC.COM");
+
+        PrincipalName sName = body.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_HST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("host", "xp1.denydc.com");
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+        sdf.setTimeZone(new SimpleTimeZone(0, "Z"));
+        Date date = sdf.parse("20370913024805");
+        assertThat(body.getTill().getTime()).isEqualTo(date.getTime());
+
+        assertThat(body.getNonce()).isEqualTo(197296424);
+
+        List<EncryptionType> eTypes = body.getEtypes();
+        assertThat(eTypes).hasSize(7);
+        assertThat(eTypes.get(0).getValue()).isEqualTo(0x0017);
+        //assertThat(eTypes.get(1).getValue()).isEqualTo(-133);//FIXME
+        //assertThat(eTypes.get(2).getValue()).isEqualTo(-128);//FIXME
+        assertThat(eTypes.get(3).getValue()).isEqualTo(0x0003);
+        assertThat(eTypes.get(4).getValue()).isEqualTo(0x0001);
+        assertThat(eTypes.get(5).getValue()).isEqualTo(0x0018);
+        //assertThat(eTypes.get(6).getValue()).isEqualTo(-135);//FIXME
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/asrep.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/asrep.token b/kerby-kerb/kerb-core/src/test/resources/asrep.token
new file mode 100644
index 0000000..d77cff7
Binary files /dev/null and b/kerby-kerb/kerb-core/src/test/resources/asrep.token differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/asreq.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/asreq.token b/kerby-kerb/kerb-core/src/test/resources/asreq.token
new file mode 100644
index 0000000..6d503b3
Binary files /dev/null and b/kerby-kerb/kerb-core/src/test/resources/asreq.token differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asrep.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asrep.token b/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asrep.token
new file mode 100644
index 0000000..91eba94
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asrep.token
@@ -0,0 +1 @@
+6b820adb30820ad7a003020105a10302010ba282085530820851308207baa103020111a28207b1048207ada08207a9308207a5808207913082078d06092a864886f70d010702a082077e3082077a020103310b300906052b0e03021a05003082012a06072b060105020302a082011d0482011930820115a08201090382010500028201000cdc45eedbf7daa0bc998f34b68f102a6fb1eaa4f7e6938cba8a27e9b78c9423f090a6f99f9ab892ad8bb48cb192bd7155b83444aaa0e2f07398bd118b73955bb80739b35c5da1b3dc9b1f75d168f9b37b0550734c63f874f2ffe7361944e17b55929601fdfd1d12aa32d740e5183167df3d1ad2558c80c277a3f8d4f9c5014557a588a75081c1a95070f3de737693ed5b7373fbb6916a9439a4d8636963a136bf3fd732b61426fd7161b19c12129e676743c4c60262d479e1a7bb79744cec7bdbe6a8741fbc665e45bb1771ad1fe8c6c35a1214c880b8217015ababddd5c6da157b085869b17a0f9cd449471d0763bd530ed4deab4d5c07219ca759888095c3a10602046b22377fa08204443082044030820328a003020102020900957b3b7d599fdde1300d06092a864886f70d0101050500307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e3
 00c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d301e170d3135303931353032313935395a170d3136303931343032313935395a307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d30820122300d06092a864886f70d01010105000382010f003082010a0282010100b490346b97ea3dbfa85d596c94b404fbacaf3b8a0f25aaddf1799008f4def1c231bdc7d6e927d29679ff8894fd7bc9912cec6d863ba32522cd9283eeb89e3fb6150d1a7d0d622e7c77b18f33a0b2569c0124cd82acc794d3a139a3037d2cf07a9decd5d27dfe2e10d52b7c80d14b5b859bb423644c1a9e97eaff6ab16a7bd157bcc24d6cf39f5f14135fa0051d47f8e3351c7dd9d5008eb074d2767e0ae7a7f58f20fb43b2c38036594c4a60aa720d5cc3d89395fe58a9ff5fcfe85fd009bc2e59c7a080eedd883ce5c151f698836cbbb9f3b8c8bad45fdcf0390ddbc9e45ddbe6cbe75c501287dbb9744f09bea7a638ef
 c03d74b25933bc0f39744423f9f2610203010001a381c43081c130090603551d1304023000300b0603551d0f0404030203e830120603551d25040b300906072b060105020305301d0603551d0e041604141f9467fe30efc615c9aa4e81097e11436ca4df09301f0603551d23041830168014423d560a460d97a08abad00436f8a4d42661d7b030090603551d120402300030480603551d110441303fa03d06062b0601050202a0333031a00d1b0b4558414d504c452e434f4da120301ea003020101a11730151b066b72627467741b0b4558414d504c452e434f4d300d06092a864886f70d010105050003820101008ef86de60f1eb04f4b611beec70bcd10294144a2e4616d7f1fc0246cd0a160f862078ced3ef41eaefb4c41a20028afa43d47c3cdaef9e3fd8b3984fb5c5092d39b6254335e55f27b2c170878415c3624c45c71297980b1d179393016209d1f338de31fc1333fd2d1d5e4556dde24a509ec46d90215ff9625302ac6dd1073be73a40f526d0153df2d9fa8fd040974b5d95344300c0b8d0c18ea27090b34a381c615e1886f02d8c714b43b4a28eb5bcc147633772cdd99bca2c601929e6672199cb250f6e863503eed53c231dbf0c417ab777044bd2ded683a3ad9946f5eb99299c2ad6e59b5164c4bcba0368a5ce16c9ff7e550dade9866bd557bdd01c71f9823318201f
 0308201ec020101308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d020900957b3b7d599fdde1300906052b0e03021a0500a03d301606092a864886f70d010903310906072b060105020302302306092a864886f70d010904311604147ba5ddc6130b5e088e9b225e90ce6996f48d8878300d06092a864886f70d0101050500048201009e1651dd0bb1b37baa7bf9c2629e161974c08a12687bf3670edc0eb43a9ecd140ae2caf4b95f71a55cf5a393ee73c6313d10e1542519cc6c6a054e63dc3bebe4584f068020ff9cb4c63d7dcd02c3e9a740b05886d0bab669b2e0611319d75f4b889ac6b306ad8694dbdc47963efa8a2c8dc775e4b060980f9bd68714aa2bde1760ecd1d40fd79f9e9ebe619918b5db7f669eac35923bd27df1d3fc69d5e496c12d53d53a4f28dd5e40517ccb02c449ba793bfd6d97fb1b0011d48c8ce555a72bc63b4ab04c5e65d09010c526f9167dba6c516f9bd1850f257ffbaaf4f4b36b14186424a7c5a537d8630dea9e5fff73cf56c8443e17bf248339525e6ec7a1890fa20e
 300ca00a06082b060105020306023033a103020113a22c042a30283026a003020112a11f1b1d4558414d504c452e434f4d57454c4c4b4e4f574e414e4f4e594d4f5553305ca10402020093a25404523050a003020112a249044716e179a3dcd5469db874d6368831355831c7e114ce594c1fd02967f0283521138719aa671409d9789d9b885c89332eb5062f95e4b7578d3d31251ff3ef4c64524a8ba7457726a2a3151b1357454c4c4b4e4f574e3a414e4f4e594d4f5553a421301fa00302010ba11830161b0957454c4c4b4e4f574e1b09414e4f4e594d4f5553a58201196182011530820111a003020105a10d1b0b4558414d504c452e434f4da220301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da381d83081d5a003020112a103020101a281c80481c5ce3b2d0bb66f8d9cd0b2c50a2c34885e718a821f78d7cc8b0e951f12115b723acf4388e3c4416a53eb5d380d08a0ca7af47d1946cecd586db4881ef62c8cfa9b1152dc9e4a28d9bb65994d58ad6acbc56f403d0092a82758855ba9d6e881cabf74ff0952fc897962186c786fb60baf75459590cce9e9b807d164f5054446ee88b3a7cce307cf5eccce040e478d291fb23f7de11c8c781217561eadf3635283271146cafa0042a90affe3ff9bc70cb824273a53bef7eb1e10dcb807440fbc054
 e815effa526a682011930820115a003020112a282010c048201084f01264b02e309704682ec1c44c550ff0a097d892e5802fbd4899215bc60be074373bf53e820a3fab5e755dae7ac938ff6b4866e3fb869913b910ff3a1b8238105b26c592a470291d864bd2780a4c91d706464f4560e0abd1998c1fa1c22e2bb35f80764ab3b39a3b273ed05f4d069722e66d0415d5e56c9acd82e2226ab7efb85ea53aa9f4f40aa057780a003e926a3d0c824165005ebbb4ce2bb9c4cf3c6e07e8b9eef74bfa7d41d445fc563e9d9ef8c3574cb804eae3d7de534b616ca4854e5919322bbd71dfb71f125f626c99aca05e1f95126b1ec8b8c5b50ca8874cf1524e682966eebfc5264e3a03086b64ac5dc66a3484265843f2336b0ca5d0c8abca96abe6fcd15a51c
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asreq.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asreq.token b/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asreq.token
new file mode 100644
index 0000000..5144f1e
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/resources/pkinit_anonymous_asreq.token
@@ -0,0 +1 @@
+6a8205f2308205eea103020105a20302010aa382054c30820548300da10402020085a20504034d495430820529a103020110a28205200482051c30820518808203e1308203dd06092a864886f70d010702a08203ce308203ca0201033100308203bf06072b060105020301a08203b2048203ae308203aaa03c303aa005020306c39ca111180f32303135313231303032353031355aa20602046b22377fa3160414e592c909d320dd4ce1ccaa4708e8bc73d48d03bfa182032a308203263082021906072a8648ce3e02013082020c0282010100ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff020102028201007fffffffffffffffe487ed5110b4611a62633145c06e0e689
 48127044533e63a0105df531d89cd9128a5043cc71a026ef7ca8cd9e69d218d98158536f92f8a1ba7f09ab6b6a8e122f242dabb312f3f637a262174d31bf6b585ffae5b7a035bf6f71c35fdad44cfd2d74f9208be258ff324943328f6722d9ee1003e5c50b1df82cc6d241b0e2ae9cd348b1fd47e9267afc1b2ae91ee51d6cb0e3179ab1042a95dcf6a9483b84b4b36b3861aa7255e4c0278ba3604650c10be19482f23171b671df1cf3b960c074301cd93c1d17603d147dae2aef837a62964ef15e5fb4aac0b8c1ccaa4be754ab5728ae9130c4c7d02880ab9472d455655347fffffffffffffff0382010500028201006c3c8337692b63f663ab2d953c5adce3dbc840339a426408761c1bced206e84c9898b2d44f35a2f0d8604752b1530580dfeb3d7649d9736ca12dcab7dafa34a8c1c143a20ff7f9103b3fdedc6208e39330bf0c3fa6be6c3a6821270d194d9f27a80f0b8e4d6f59a75a0e384a588cfbecf75ac294d85ab8966ba26f49562c56f57c450cd1eacad30f5994dac89ab11d3229e9d1d6aaa4e80aead122115aa2a737dc82a70a99e6f50892135d5d50442b88243c564b6c5b7975def3dbc7c541e4c83b55aee3b44a989cb577b6c7d3b583463d026eb8aad908bfc8d9e4186ac7a7ba17d4c9c591e035fd9ab1325bb21544bb63f18bb499c8af244cc92ee4497533b1a20e
 300c300a06082a864886f70d0307a42c302a300ca00a06082b06010502030602300ca00a06082b06010502030601300ca00a06082b060105020306033100a182012f3082012b30820127807e307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d81818c308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d0209009f561dd97cee1bf982160414423d560a460d97a08abad00436f8a4d42661d7b0300aa10402020095a2020400a4819130818ea00703050000008010a121301fa00302010ba11830161b0957454c4c4b4e4f574e1b09414e4f4e594d4f5553a20d1b0b4558414d504c452e434f4da320301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da511180f32303135313231313032353031355
 aa70602046b22377fa814301202011202011102011002011702011902011a
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asrep.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asrep.token b/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asrep.token
new file mode 100644
index 0000000..6d647de
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asrep.token
@@ -0,0 +1 @@
+6b820b4530820b41a003020105a10302010ba28208ae308208aa308208a6a103020111a282089d04820899818208953082089106092a864886f70d010703a08208823082087e020100318201a6308201a2020100308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d020900957b3b7d599fdde2300d06092a864886f70d0101010500048201001d63284bd7dbe9f46b42fdf40c1e5267e2860b5d872669622cfd7ff339008670e2a6ed0919b4da5bf99bfc93724249ff9f8adc72fa8a407c68153b40a607ff657103e8b9c8260ce2e3082fe3d91aad81ee61ebcdf0c6fec9db0d3dc2ea2895e57230a963818743457f704ed57087ecfba58b86d54f94622b89a66de024c9139004d32132a46a35e54bba070c2b6bc20eb01772436ef868c9cb16e73c9a1b00cbe0922f857271f28e1180cfda9a2c8703b185e9fd34aa2c7a83dd0f797dc75465210920272377753a82bafd382a949a19e0a7ea60aec456986e050a060620b8ec71138e362e6fdb8fd4cba99f0c2082dbb17e858a96839cf39381f41316b8b3d
 1308206cd06092a864886f70d010702301406082a864886f70d03070408aac7b1e3f23bda60808206a8b8d542124bbd8c777a18dc50ccb2d5c5f8079a28351905e2db02597cbe6937283886e37ffaa97dcd455d2bd2a19dd2463ef0e5583abc93b356c953bb165327fd35d8776c6ff57e5767f51e8277ee84b58fb18762f3d326bd4eab70e434c5128d94e39633cfe6243c4224f6ab9df155af10cc0c038075e3d321e8ccbda4712b48f5cac6a0803e931ce4742fd4efaa3bd9975dc4f62fef96c116a93c5cd6fe1a9045450357f483c352bb16e1ccd1502cc02cd45ea66a6279ae593a2cc604a4204b0431ad64006c5fd4505109550bc47f23969e4b822c8eba6448f4b92bfc6df61c349ee8a30aa3c86aedc165116314b77673877299bc58245419f32de685735fdb69f51cfeee6f825ab489f8bf3ef86549d745a3b3f6039c26312b47a26a9e4217ab3f0e2500acf0a2c4069087091ba408808501d348585ff7732edc1fa8f7d7eb38d7b208a39c347557712214b26f98ab8f68fe0a2ebab643779e2216d5e78d69779b37730d80510152f1b7de1abbd0ec09fe623e35b16fff7fdef02bc51173ccc9a2ea1fedfe115b35da21b86072f384cce741470e8c8ff25dcf313b08c8b4bbd7384580a8a3a229f930bce5ebf41bac5b0cabc36fb190b18aa0ad25e114f807adb45c789745b51d9e
 5cd52f139c3ae890681ddd89b34fac0f09afa9ab6ef0c2e21f266507cb2c820cf9e2fc24bde9f9a15892b8c9a5fd7d277c6d87e9b3c215f3f712a9ff3db3f3f2a6c9bef2f8a7066544b90a28e1e6f5c717c8bfee38f65c2bb816bb488a54b164d4d43c8524a98ee9e2bc7c1b85bf4abb93ece192438747277756d3c07840ff55625d310164aae88ed93df37e160a12940241c3b23009e096a5321e859e109ed50c5bd954e769518477cc67fd1321af7ecc345973f798969eff2f15577f3fc556d0a7e646e8eadf91b78d5ae563c781ebf8754deebc54aa69165a4f88efbfb4a19f101e5b72fd8247dae768e95f0fb072ac594bb9ed7d33e2b2f21e2ad2e6324a114700dcfb532988811faf2e180baa0fdb6b53e8955decbc0ae82e47630196f7b825cdf6876ef9ecda9bc6d0f46b11a688ea275afc1118ab72fbd983df2f8817c4415582b905d9e76eb472ac82b2568e3a3a653949e08c87fd19a7f4f2533bfdd121064f8abec63badf845db4ef9d215c4ca66e61d22ac636db6bfb0988f0ec8d3181d0dfe9a569e590e3fa006c88080ec58093a07d7b550a7186e8cdd02aac9f2d2d4a1b0d34d76a69d8c2d1a757bed099fc30a14cea6c585f26c619090ba597e46fcc8c60ae7f2e8d30ad8a2996e7e8f2838ab31855a09404dc5b499184fc48ef4854d6914f53b21829e0350a851569f155
 2420c4372e246ead39945f96efd04471cf6f81ee1430118181d118007bded3d9d42bf03cf8c156e0f27f77ed4c6aaebdcb95b27f79503ba5fc2deea6822c2e4998c3dbd73b063dc992ae98f4928bdbf6f56718df014fdbe1bf634e1dc3cbc877c1dde9acf622cdf1894984fe8739bfd6d1ce77309352e99fb947641d90941d38dcf9c9db43929c9f30f881eb6ab5755f9c8bc912f222a9c17785aad26587e5919af9be2847dcfa9202fddd045ad579f27b075b15590154a444d01cd96a63840c7c4bb7d4554da83e1180f914b0e3679c013f804b71df34f5e238ed82890c97f3170966607512a6871989a03294d81ca9fb3c1e57f801c807eaee97613c451deef82499fda1edf8837afc51273f2857760a111e7a4dba8f5ce4aecdb9332d0629d4f5d1fd84c77d7c0adba18e2c9b25c764f656121452f914b8e7dd715a4fe50b76f95ef619894a2081f17e1ebab9db5af4e257bf363884a6b762f56d42ac9359e84f8d7c774ea5315381ee28bf11153bb9c705941b2a40ffe553d9fb3605985ccac44c475e1bcc38adba2b6de41bc3da6a8ae7126816a57dc9ce2b644cd3e71c19508de9465b7ecf24bdebd32a232358901df9c112e08b0fb23590c66d77c2b7cb7e9600117eecc1375b592d3b8bc7c3c660cba398b7e82ff02693af3096ff7bf894b4d52cfc6a3ef4d74483b71f215996b9b
 9bab982f4927409316d0dc5cf64c7d33e772a117a3a4fcb449e0a8445b8b98c4035e56c000db33a8719c6cbb8e4775b2775fcb0b7261a98282461d7d1ede20f6e7f4f3e0e1c0bc1b92332053c70a0d69c94568c54a84f4795a32eba0ccefc08e6cc83e46821a6445c5b90cde8a658916133109db2a90e94edcc8389eb810d3d65bb8de628ebcab33877578bb0f6d5b80a9dfc1e2c8cc31033b78dfa8541205cac94bdf78e88c91f1261b4e654e9f737c137e317b9e91d05ceca45a26a7a7f9a5cd703a8e13d3868935ae5959792128ef9877b0a8c6fbae29874f4838ed0967b11f39337a43ab0bc8ee7163aceeebdbe4ffc6574b461c0158c8eea30d1b0b4558414d504c452e434f4da4133011a003020101a10a30081b066a69616a6961a58201406182013c30820138a003020105a10d1b0b4558414d504c452e434f4da220301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da381ff3081fca003020112a103020101a281ef0481ecbf4cd0902315c4bf005955384ccec42bdbc4c310e483aedcba9e8f0f32c6612e2c70f5cbe703f57b223da8d7f2abb4ed8a97a65b2df4a117a4017c78ab627f97886b8a29e6a7f3bc7333bf0c7ae9f936899379243c490f6f796f1c5668501faa5a8203d9006c76dbc0495db1ea26bf358b46bf49be2b9ede331965f72
 fe01676815a5013e7cb94d5cb1b693ef147e12e6146887dcfd7b683618c7d907f00bfc3970ebf97a4659d9095714ac760eaa6481e4b1357598d8e3f5179e13bc7b566178c7b354e86d49d4460bb021991156817eb0237f63431742fb7c2457aafcc09022de7c7b975faed36e78f7fa3a682011930820115a003020112a282010c04820108b0b22e40b0910f9d18428c1d444054ce7b2d249c8a5896bbd80ed16cf880386d48e41880f2a579addae3573514c8877bbb6beb12bba0dcdc1171044332dc50816c8d70b5b1b9610281f53b2d5297e5977f4bf589e7c8eecdcd5b4bcbe2e05ad1183d8c1b3b23d650970c8e57f330d9eb307dddf1be513f427cd11cf8acf897e18fc792b94b6d8fcc81ee72602d7778905ee7a65e1112500d8bf8670da1342006afbc46fd0e406233afa3850d759d889832d5e28f56744cca4d806c740b8fbee2951a2945888298478005b68c4c6d9f86482583caefb46895e0b6b4727266d79ad09bafa483ea26e9515068e22c945dac1be7bdd0ae3475572d1962b5e44ab0bf53123225fb122882
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asreq.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asreq.token b/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asreq.token
new file mode 100644
index 0000000..3e54cb3
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/test/resources/pkinit_rsa_asreq.token
@@ -0,0 +1 @@
+6a8208e8308208e4a103020105a20302010aa38208503082084c300da10402020085a20504034d49543082082da103020110a2820824048208203082081c808206e5308206e106092a864886f70d010702a08206d2308206ce020103310b300906052b0e03021a050030818c06072b060105020301a08180047e307ca03c303aa00502030af6e8a111180f32303135313231373032313233355aa206020427473b49a316041450cfad80b9dcaf2021e8563b335f91de58b201f9a20e300c300a06082a864886f70d0307a42c302a300ca00a06082b06010502030602300ca00a06082b06010502030601300ca00a06082b06010502030603a0820437308204333082031ba003020102020900957b3b7d599fdde2300d06092a864886f70d0101050500307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d301e170d3135303931353032323134385a170d3136303931343032323134385a307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040
 a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d30820122300d06092a864886f70d01010105000382010f003082010a02820101009e17eda99c0bd68ac7d2859c0c1f6a3556c62ff12b289d4067b0d01bb2a647be4741909a2b83994c4d02edba7208fc7b99d2a2c1d6845ac7a0ab9aeca5f1aeea712339f4644538b1abb4f4a693303c48cd1e6915b8307b630ba2e2b1ae5083df33385d6264cf7f999c8162951afcc38478c1f996733d048c87a23185951b50ff790a048428263f47547f8cb2e6a914915491443909ae9b77fb2c02794c28af2938afce86b70a2f80cb4ba5111d51c34f6c760c82d6589d3d763a032e3b6887db3b3b5bfaa3d2bef5df044cce76701ffb6f8582e4e9a86dad9b640b57b763379564c3161d301be17cfd04a6fc3eae9a07e5cf4630c4f34ab0fe48af1aaf57f6970203010001a381b73081b430090603551d1304023000300b0603551d0f0404030203a830120603551d25040b300906072b060105020304301d0603551d0e0416041464fddc08dfafd2c04ec64865d73e0d2f4a6fbd91301f0603551d23041830168014423d560a460d97a08abad00436f8a4d42661d7b030090603551d1204023000303b06
 03551d1104343032a03006062b0601050202a0263024a00d1b0b4558414d504c452e434f4da1133011a003020101a10a30081b066a69616a6961300d06092a864886f70d0101050500038201010094685852d004eb658edfb2bc96fb9754361dbbfbb06e83ee770baf2500a2cabfec736fe7f45d283d0270a9a826dbe945f4d036befb15afd8ea0af070c428332a0f375e86fea27e0f3416f2d44b8328d77d7b33af08c3c3443e8618a4eb52d5d4e1c8dddf6cb320c3643e75a0b05156f08e4c219ee89e6df8915d7272676710caae1f37f5cf002898383881d7fee3873b1cad07a117a9e2c9db6f1bbae32f188a4f51383681d917eb8ea78ba67b979e7bcef09adfb01c9b9739be9246eee8423895f11c0ba5d4946f18cfaad348795c9efc7fedfeb8eec5447cc156301cc618eb220955ce02d445b9f0403bfd3dfc4940358dd9a095429a9f885bd908c8c96671318201f0308201ec020101308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d020900957b3b7d599fdde2300906052b0e03021a0500a03d3
 01606092a864886f70d010903310906072b060105020301302306092a864886f70d01090431160414c231f11c62b4f747fe33023a9be475902f6ad068300d06092a864886f70d0101050500048201002f1e046ff68a8554c6a988b7a82975a6dd908cb633fae367c2960b7c62a50d814f132fd3ec381f9d59800ad58654fe4c3de1cc9ab3ae3cd183cb737530609ab3487a2fda32897ab8e8a4c264b5cc2be03c38b25593ddd787477daa324116ab11d143610b657f5bed5b2bd5a111f4dbf887a356a0049265ec3728c08e4d568b834000e931a3b722ed6a27096a21c4301686920ba3195ccc9b203a9287c880a1068701c5b3d66f35abc5097ebdea93a9b6a85f147391057913da62d9b4600a0f585b9bef11381432f3837173a82d7762e7bf1984e454c3e91f378459852ae9751d496e185ab8a659f9d8ba0cab7fcd210176fc6bfb55d9004a49b06f634279c9ffa182012f3082012b30820127807e307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d81818c308189307c310b300906035504061302434e310b
 300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d0209009f561dd97cee1bf982160414423d560a460d97a08abad00436f8a4d42661d7b0300aa10402020095a2020400a48183308180a00703050000000010a1133011a003020101a10a30081b066a69616a6961a20d1b0b4558414d504c452e434f4da320301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da511180f32303135313231383032313233355aa706020427473b49a814301202011202011102011002011702011902011a
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/server.keytab
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/server.keytab b/kerby-kerb/kerb-core/src/test/resources/server.keytab
new file mode 100644
index 0000000..b44347c
Binary files /dev/null and b/kerby-kerb/kerb-core/src/test/resources/server.keytab differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/tgsrep.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/tgsrep.token b/kerby-kerb/kerb-core/src/test/resources/tgsrep.token
new file mode 100644
index 0000000..25d6270
Binary files /dev/null and b/kerby-kerb/kerb-core/src/test/resources/tgsrep.token differ

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/17488030/kerby-kerb/kerb-core/src/test/resources/tgsreq.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/test/resources/tgsreq.token b/kerby-kerb/kerb-core/src/test/resources/tgsreq.token
new file mode 100644
index 0000000..69f6b46
Binary files /dev/null and b/kerby-kerb/kerb-core/src/test/resources/tgsreq.token differ


Mime
View raw message