directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r125508 - in incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io: decoder encoder
Date Tue, 18 Jan 2005 14:23:20 GMT
Author: erodriguez
Date: Tue Jan 18 06:23:17 2005
New Revision: 125508

URL: http://svn.apache.org/viewcvs?view=rev&rev=125508
Log:
Refactoring based on new DER library support.
Modified:
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/ApplicationRequestDecoder.java	Tue Jan 18 06:23:17 2005
@@ -24,14 +24,15 @@
 import org.apache.asn1.der.ASN1InputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERBitString;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERInteger;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.ApplicationRequest;
 import org.apache.kerberos.messages.MessageType;
 import org.apache.kerberos.messages.value.ApOptions;
 
+
 public class ApplicationRequestDecoder extends KerberosMessageDecoder {
 	
 	public ApplicationRequest decode(byte[] encodedAuthHeader) throws IOException {
@@ -62,19 +63,19 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger) derObject;
-					authHeader.setProtocolVersionNumber(tag0.getValue().intValue());
+					authHeader.setProtocolVersionNumber(tag0.intValue());
 					break;
 				case 1:
 					DERInteger tag1 = (DERInteger) derObject;
-					authHeader.setMessageType(MessageType.getTypeByOrdinal(tag1.getValue().intValue()));
+					authHeader.setMessageType( MessageType.getTypeByOrdinal( tag1.intValue() ) );
 					break;
 				case 2:
 					DERBitString apOptions = (DERBitString)derObject;
-					authHeader.setApOptions(new ApOptions(apOptions.getBytes()));
+					authHeader.setApOptions( new ApOptions( apOptions.getOctets() ) );
 					break;
 				case 3:
 					DERApplicationSpecific tag3 = (DERApplicationSpecific)derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java	Tue Jan 18 06:23:17 2005
@@ -23,9 +23,9 @@
 
 import org.apache.asn1.der.ASN1InputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERGeneralizedTime;
 import org.apache.asn1.der.DERInteger;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
@@ -53,7 +53,7 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DEROctetString tag0 = (DEROctetString) derObject;
@@ -65,11 +65,11 @@
 					break;
 				case 2:
 					DERInteger tag2 = (DERInteger)derObject;
-					modifier.setMicroSecond(new Integer(tag2.getValue().intValue()));
+					modifier.setMicroSecond(new Integer(tag2.intValue()));
 					break;
 				case 3:
 					DERInteger tag3 = (DERInteger)derObject;
-					modifier.setSequenceNumber(new Integer(tag3.getValue().intValue()));
+					modifier.setSequenceNumber(new Integer(tag3.intValue()));
 					break;
 				case 4:
 					DERSequence tag4 = (DERSequence)derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java	Tue Jan 18 06:23:17 2005
@@ -24,9 +24,9 @@
 import org.apache.asn1.der.ASN1InputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERBitString;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERGeneralString;
 import org.apache.asn1.der.DERGeneralizedTime;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.components.EncTicketPart;
@@ -70,11 +70,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERBitString tag0 = (DERBitString)derObject;
-					modifier.setFlags(new TicketFlags(tag0.getBytes()));
+					modifier.setFlags(new TicketFlags(tag0.getOctets()));
 					break;
 				case 1:
 					DERSequence tag1 = (DERSequence) derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java	Tue Jan 18 06:23:17 2005
@@ -24,10 +24,10 @@
 import org.apache.asn1.der.ASN1InputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERBitString;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERGeneralString;
 import org.apache.asn1.der.DERGeneralizedTime;
 import org.apache.asn1.der.DERInteger;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
@@ -75,15 +75,15 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 1:
 					DERInteger tag1 = (DERInteger)derObject;
-					pvno = tag1.getValue().intValue();
+					pvno = tag1.intValue();
 					break;
 				case 2:
 					DERInteger tag2 = (DERInteger)derObject;
-					msgType = MessageType.getTypeByOrdinal(tag2.getValue().intValue());
+					msgType = MessageType.getTypeByOrdinal(tag2.intValue());
 					break;
 				case 3:
 					DERSequence tag3 = (DERSequence)derObject;
@@ -129,11 +129,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 1:
 					DERInteger padataType = (DERInteger) derObject;
-					PreAuthenticationDataType type = PreAuthenticationDataType.getTypeByOrdinal(padataType.getValue().intValue());
+					PreAuthenticationDataType type = PreAuthenticationDataType.getTypeByOrdinal(padataType.intValue());
 					modifier.setDataType(type);
 					break;
 				case 2:
@@ -174,11 +174,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERBitString kdcOptions = (DERBitString)derObject;
-					modifier.setKdcOptions(new KdcOptions(kdcOptions.getBytes()));
+					modifier.setKdcOptions(new KdcOptions(kdcOptions.getOctets()));
 					break;
 				case 1:
 					DERSequence cName = (DERSequence)derObject;
@@ -206,7 +206,7 @@
 					break;
 				case 7:
 					DERInteger nonce = (DERInteger)derObject;
-					modifier.setNonce(nonce.getValue().intValue());
+					modifier.setNonce(nonce.intValue());
 					break;
 				case 8:
 					DERSequence etype = (DERSequence)derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java	Tue Jan 18 06:23:17 2005
@@ -25,10 +25,10 @@
 import java.util.Enumeration;
 
 import org.apache.asn1.der.DERApplicationSpecific;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERGeneralString;
 import org.apache.asn1.der.DERGeneralizedTime;
 import org.apache.asn1.der.DERInteger;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
@@ -98,11 +98,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					modifier.setTicketVersionNumber(tag0.getValue().intValue());
+					modifier.setTicketVersionNumber(tag0.intValue());
 					break;
 				case 1:
 					DERGeneralString tag1 = (DERGeneralString)derObject;
@@ -137,15 +137,15 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger etype = (DERInteger)derObject;
-					modifier.setEncryptionType(EncryptionType.getTypeByOrdinal(etype.getValue().intValue()));
+					modifier.setEncryptionType(EncryptionType.getTypeByOrdinal(etype.intValue()));
 					break;
 				case 1:
 					DERInteger kvno = (DERInteger)derObject;
-					modifier.setKeyVersion(kvno.getValue().intValue());
+					modifier.setKeyVersion(kvno.intValue());
 					break;
 				case 2:
 					DEROctetString cipher = (DEROctetString)derObject;
@@ -171,11 +171,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger nameType = (DERInteger)derObject;
-					modifier.setType(nameType.getValue().intValue());
+					modifier.setType(nameType.intValue());
 					break;
 				case 1:
 					DERSequence nameString = (DERSequence)derObject;
@@ -221,7 +221,7 @@
 		
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERInteger object = ((DERInteger) e.nextElement());
-			eTypes[i] = EncryptionType.getTypeByOrdinal(object.getValue().intValue());
+			eTypes[i] = EncryptionType.getTypeByOrdinal(object.intValue());
 			i++;
 		}
 		return eTypes;
@@ -240,11 +240,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger addressType = (DERInteger)derObject;
-					type = HostAddressType.getTypeByOrdinal(addressType.getValue().intValue());
+					type = HostAddressType.getTypeByOrdinal(addressType.intValue());
 					break;
 				case 1:
 					DEROctetString address = (DEROctetString)derObject;
@@ -289,11 +289,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					type = ChecksumType.getTypeByOrdinal(tag0.getValue().intValue());
+					type = ChecksumType.getTypeByOrdinal(tag0.intValue());
 					break;
 				case 1:
 					DEROctetString tag1 = (DEROctetString)derObject;
@@ -319,11 +319,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					type = EncryptionType.getTypeByOrdinal(tag0.getValue().intValue());
+					type = EncryptionType.getTypeByOrdinal(tag0.intValue());
 					break;
 				case 1:
 					DEROctetString tag1 = (DEROctetString)derObject;
@@ -365,11 +365,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					type = LastRequestType.getTypeByOrdinal(tag0.getValue().intValue());
+					type = LastRequestType.getTypeByOrdinal(tag0.intValue());
 					break;
 				case 1:
 					DERGeneralizedTime tag1 = (DERGeneralizedTime)derObject;
@@ -394,11 +394,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger) derObject;
-					type = TransitedEncodingType.getTypeByOrdinal(tag0.getValue().intValue());
+					type = TransitedEncodingType.getTypeByOrdinal(tag0.intValue());
 					break;
 				case 1:
 					DEROctetString tag1 = (DEROctetString) derObject;
@@ -438,11 +438,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					type = AuthorizationType.getTypeByOrdinal(tag0.getValue().intValue());
+					type = AuthorizationType.getTypeByOrdinal(tag0.intValue());
 					break;
 				case 1:
 					DEROctetString tag1 = (DEROctetString)derObject;
@@ -478,11 +478,11 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger)derObject;
-					modifier.setVersionNumber(tag0.getValue().intValue());
+					modifier.setVersionNumber(tag0.intValue());
 					break;
 				case 1:
 					DERGeneralString tag1 = (DERGeneralString)derObject;
@@ -498,7 +498,7 @@
 					break;
 				case 4:
 					DERInteger tag4 = (DERInteger)derObject;
-					modifier.setClientMicroSecond(tag4.getValue().intValue());
+					modifier.setClientMicroSecond(tag4.intValue());
 					break;
 				case 5:
 					DERGeneralizedTime tag5 = (DERGeneralizedTime)derObject;
@@ -510,7 +510,7 @@
 					break;
 				case 7:
 					DERInteger tag7 = (DERInteger)derObject;
-					modifier.setSequenceNumber(tag7.getValue().intValue());
+					modifier.setSequenceNumber(tag7.intValue());
 					break;
 				case 8:
 					DERSequence tag8 = (DERSequence)derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/PrivateMessageDecoder.java	Tue Jan 18 06:23:17 2005
@@ -23,8 +23,8 @@
 
 import org.apache.asn1.der.ASN1InputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
+import org.apache.asn1.der.DEREncodable;
 import org.apache.asn1.der.DERInteger;
-import org.apache.asn1.der.DERObject;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
 import org.apache.kerberos.messages.MessageType;
@@ -50,15 +50,15 @@
 		for (Enumeration e = sequence.getObjects(); e.hasMoreElements();) {
 			DERTaggedObject object = ((DERTaggedObject) e.nextElement());
 			int tag = object.getTagNo();
-			DERObject derObject = object.getObject();
+			DEREncodable derObject = object.getObject();
 			switch (tag) {
 				case 0:
 					DERInteger tag0 = (DERInteger) derObject;
-					message.setProtocolVersionNumber(tag0.getValue().intValue());
+					message.setProtocolVersionNumber(tag0.intValue());
 					break;
 				case 1:
 					DERInteger tag1 = (DERInteger) derObject;
-					message.setMessageType(MessageType.getTypeByOrdinal(tag1.getValue().intValue()));
+					message.setMessageType(MessageType.getTypeByOrdinal(tag1.intValue()));
 					break;
 				case 3:
 					DERSequence tag3 = (DERSequence)derObject;

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ApplicationReplyEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -37,7 +36,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence replySequence = encodeReplySequence(reply);
-		aos.writeObject(new DERApplicationSpecific(APPLICATION_CODE, replySequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(APPLICATION_CODE, replySequence));
 		aos.close();
 		
 		return baos.toByteArray();
@@ -45,13 +44,13 @@
 	
 	private DERSequence encodeReplySequence(ApplicationReply message) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(message.getProtocolVersionNumber())));
-		vector.add(new DERTaggedObject(1, new DERInteger(message.getMessageType().getOrdinal())));
-		vector.add(new DERTaggedObject(2, encodeEncryptedData(message.getEncPart())));
+		sequence.add(new DERTaggedObject(0, DERInteger.valueOf( message.getProtocolVersionNumber() )));
+		sequence.add(new DERTaggedObject(1, DERInteger.valueOf(message.getMessageType().getOrdinal())));
+		sequence.add(new DERTaggedObject(2, encodeEncryptedData(message.getEncPart())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -37,7 +36,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence privPartSequence = encodeApRepPartSequence(apRepPart);
-		aos.writeObject(new DERApplicationSpecific(APPLICATION_CODE, privPartSequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(APPLICATION_CODE, privPartSequence));
 		aos.close();
 		
 		return baos.toByteArray();
@@ -45,16 +44,16 @@
 	
 	private DERSequence encodeApRepPartSequence(EncApRepPart message) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, encodeKerberosTime(message.getClientTime())));
-		vector.add(new DERTaggedObject(1, new DERInteger(message.getClientMicroSecond())));
+		sequence.add(new DERTaggedObject(0, encodeKerberosTime(message.getClientTime())));
+		sequence.add(new DERTaggedObject(1, DERInteger.valueOf(message.getClientMicroSecond())));
 		if (message.getSubSessionKey() != null)
-			vector.add(new DERTaggedObject(2, encodeEncryptionKey(message.getSubSessionKey())));
+			sequence.add(new DERTaggedObject(2, encodeEncryptionKey(message.getSubSessionKey())));
 		if (message.getSequenceNumber() != null)
-			vector.add(new DERTaggedObject(3, new DERInteger(message.getSequenceNumber().intValue())));
+			sequence.add(new DERTaggedObject(3, DERInteger.valueOf(message.getSequenceNumber().intValue())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java	Tue Jan 18 06:23:17 2005
@@ -17,15 +17,16 @@
 
 package org.apache.kerberos.io.encoder;
 
-public class EncAsRepPartEncoder extends EncKdcRepPartEncoder {
-	
+public class EncAsRepPartEncoder extends EncKdcRepPartEncoder
+{
 	/*
 	 * EncASRepPart ::=    [APPLICATION 25[25]] EncKDCRepPart
 	 */
 	public static final int APPLICATION_CODE = 25;
 	
-	public EncAsRepPartEncoder() {
-		super(APPLICATION_CODE);
+	public EncAsRepPartEncoder()
+	{
+		super( APPLICATION_CODE );
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -41,7 +40,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence initialSequence = encodeInitialSequence(app);
-		aos.writeObject(new DERApplicationSpecific(_applicationCode, initialSequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(_applicationCode, initialSequence));
 		
 		return baos.toByteArray();
 	}
@@ -64,37 +63,37 @@
 	}*/
 	protected DERSequence encodeInitialSequence(KdcReply reply) {
 
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, encodeEncryptionKey(reply.getKey())));
-		vector.add(new DERTaggedObject(1, encodeLastRequest(reply.getLastRequest())));
-		vector.add(new DERTaggedObject(2, new DERInteger(reply.getNonce())));
+		sequence.add(new DERTaggedObject(0, encodeEncryptionKey(reply.getKey())));
+		sequence.add(new DERTaggedObject(1, encodeLastRequest(reply.getLastRequest())));
+		sequence.add(new DERTaggedObject(2, DERInteger.valueOf(reply.getNonce())));
 		
 		// OPTIONAL
 		if (reply.getKeyExpiration() != null)
-			vector.add(new DERTaggedObject(3, encodeKerberosTime(reply.getKeyExpiration())));
+			sequence.add(new DERTaggedObject(3, encodeKerberosTime(reply.getKeyExpiration())));
 		
-		vector.add(new DERTaggedObject(4, encodeTicketFlags(reply.getFlags())));
-		vector.add(new DERTaggedObject(5, encodeKerberosTime(reply.getAuthTime())));
+		sequence.add(new DERTaggedObject(4, encodeTicketFlags(reply.getFlags())));
+		sequence.add(new DERTaggedObject(5, encodeKerberosTime(reply.getAuthTime())));
 		
 		// OPTIONAL
 		if (reply.getStartTime() != null)
-			vector.add(new DERTaggedObject(6, encodeKerberosTime(reply.getStartTime())));
+			sequence.add(new DERTaggedObject(6, encodeKerberosTime(reply.getStartTime())));
 		
-		vector.add(new DERTaggedObject(7, encodeKerberosTime(reply.getEndTime())));
+		sequence.add(new DERTaggedObject(7, encodeKerberosTime(reply.getEndTime())));
 		
 		// OPTIONAL
 		if (reply.getRenewTill() != null)
-			vector.add(new DERTaggedObject(8, encodeKerberosTime(reply.getRenewTill())));
+			sequence.add(new DERTaggedObject(8, encodeKerberosTime(reply.getRenewTill())));
 		
-		vector.add(new DERTaggedObject(9, encodeRealm(reply.getServerRealm())));
-		vector.add(new DERTaggedObject(10, encodePrincipalName(reply.getServerPrincipal())));
+		sequence.add(new DERTaggedObject(9, encodeRealm(reply.getServerRealm())));
+		sequence.add(new DERTaggedObject(10, encodePrincipalName(reply.getServerPrincipal())));
 		
 		// OPTIONAL
 		if (reply.getClientAddresses() != null)
-			vector.add(new DERTaggedObject(11, encodeHostAddresses(reply.getClientAddresses())));
+			sequence.add(new DERTaggedObject(11, encodeHostAddresses(reply.getClientAddresses())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -38,7 +37,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence privPartSequence = encodePrivatePartSequence(privPart);
-		aos.writeObject(new DERApplicationSpecific(APPLICATION_CODE, privPartSequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(APPLICATION_CODE, privPartSequence));
 		aos.close();
 		
 		return baos.toByteArray();
@@ -46,20 +45,20 @@
 	
 	private DERSequence encodePrivatePartSequence(EncKrbPrivPart message) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DEROctetString(message.getUserData())));
+		sequence.add(new DERTaggedObject(0, new DEROctetString(message.getUserData())));
 		if (message.getTimestamp() != null)
-			vector.add(new DERTaggedObject(1, encodeKerberosTime(message.getTimestamp())));
+			sequence.add(new DERTaggedObject(1, encodeKerberosTime(message.getTimestamp())));
 		if (message.getMicroSecond() != null)
-			vector.add(new DERTaggedObject(2, new DERInteger(message.getMicroSecond().intValue())));
+			sequence.add(new DERTaggedObject(2, DERInteger.valueOf(message.getMicroSecond().intValue())));
 		if (message.getSequenceNumber() != null)
-			vector.add(new DERTaggedObject(3, new DERInteger(message.getSequenceNumber().intValue())));
-		vector.add(new DERTaggedObject(4, encodeHostAddress(message.getSenderAddress())));
+			sequence.add(new DERTaggedObject(3, DERInteger.valueOf(message.getSequenceNumber().intValue())));
+		sequence.add(new DERTaggedObject(4, encodeHostAddress(message.getSenderAddress())));
 		if (message.getRecipientAddress() != null)
-			vector.add(new DERTaggedObject(5, encodeHostAddress(message.getRecipientAddress())));
+			sequence.add(new DERTaggedObject(5, encodeHostAddress(message.getRecipientAddress())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERSequence;
@@ -36,7 +35,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence ticketSequence = encodeInitialSequence(ticketPart);
-		aos.writeObject(new DERApplicationSpecific(APPLICATION_CODE, ticketSequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(APPLICATION_CODE, ticketSequence));
 		aos.close();
 		
 		return baos.toByteArray();
@@ -58,30 +57,30 @@
 	                      authorization-data[10]   AuthorizationData OPTIONAL
 	}*/
 	public DERSequence encodeInitialSequence(EncTicketPart ticketPart) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, encodeTicketFlags(ticketPart.getFlags())));
-		vector.add(new DERTaggedObject(1, encodeEncryptionKey(ticketPart.getSessionKey())));
-		vector.add(new DERTaggedObject(2, encodeRealm(ticketPart.getClientRealm())));
-		vector.add(new DERTaggedObject(3, encodePrincipalName(ticketPart.getClientPrincipal())));
-		vector.add(new DERTaggedObject(4, encodeTransitedEncoding(ticketPart.getTransitedEncoding())));
-		vector.add(new DERTaggedObject(5, encodeKerberosTime(ticketPart.getAuthTime())));
+		sequence.add(new DERTaggedObject(0, encodeTicketFlags(ticketPart.getFlags())));
+		sequence.add(new DERTaggedObject(1, encodeEncryptionKey(ticketPart.getSessionKey())));
+		sequence.add(new DERTaggedObject(2, encodeRealm(ticketPart.getClientRealm())));
+		sequence.add(new DERTaggedObject(3, encodePrincipalName(ticketPart.getClientPrincipal())));
+		sequence.add(new DERTaggedObject(4, encodeTransitedEncoding(ticketPart.getTransitedEncoding())));
+		sequence.add(new DERTaggedObject(5, encodeKerberosTime(ticketPart.getAuthTime())));
 		
 		// OPTIONAL
 		if (ticketPart.getStartTime() != null)
-			vector.add(new DERTaggedObject(6, encodeKerberosTime(ticketPart.getStartTime())));
+			sequence.add(new DERTaggedObject(6, encodeKerberosTime(ticketPart.getStartTime())));
 		
-		vector.add(new DERTaggedObject(7, encodeKerberosTime(ticketPart.getEndTime())));
+		sequence.add(new DERTaggedObject(7, encodeKerberosTime(ticketPart.getEndTime())));
 		
 		// OPTIONAL
 		if (ticketPart.getRenewTill() != null)
-			vector.add(new DERTaggedObject(8, encodeKerberosTime(ticketPart.getRenewTill())));
+			sequence.add(new DERTaggedObject(8, encodeKerberosTime(ticketPart.getRenewTill())));
 		if (ticketPart.getClientAddresses() != null)
-			vector.add(new DERTaggedObject(9, encodeHostAddresses(ticketPart.getClientAddresses())));
+			sequence.add(new DERTaggedObject(9, encodeHostAddresses(ticketPart.getClientAddresses())));
 		if (ticketPart.getAuthorizationData() != null)
-			vector.add(new DERTaggedObject(10, encodeAuthorizationData(ticketPart.getAuthorizationData())));
+			sequence.add(new DERTaggedObject(10, encodeAuthorizationData(ticketPart.getAuthorizationData())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/ErrorMessageEncoder.java	Tue Jan 18 06:23:17 2005
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERGeneralString;
@@ -38,7 +37,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream( newOutputStream( out ) );
 		
 		DERSequence errorReply = encodeErrorMessageSequence( message );
-		aos.writeObject( new DERApplicationSpecific( message.getMessageType().getOrdinal(), errorReply ) );
+		aos.writeObject( DERApplicationSpecific.valueOf( message.getMessageType().getOrdinal(), errorReply ) );
 		
 		aos.close();
 	}
@@ -49,7 +48,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence errorReply = encodeErrorMessageSequence(message);
-		aos.writeObject(new DERApplicationSpecific(message.getMessageType().getOrdinal(), errorReply));
+		aos.writeObject( DERApplicationSpecific.valueOf(message.getMessageType().getOrdinal(), errorReply));
 		
 		aos.close();
 		
@@ -58,29 +57,29 @@
 	
 	private DERSequence encodeErrorMessageSequence(ErrorMessage message) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(message.getProtocolVersionNumber())));
-		vector.add(new DERTaggedObject(1, new DERInteger(message.getMessageType().getOrdinal())));
+		sequence.add(new DERTaggedObject(0, DERInteger.valueOf(message.getProtocolVersionNumber())));
+		sequence.add(new DERTaggedObject(1, DERInteger.valueOf(message.getMessageType().getOrdinal())));
 		if (message.getClientTime() != null)
-			vector.add(new DERTaggedObject(2, encodeKerberosTime(message.getClientTime())));
+			sequence.add(new DERTaggedObject(2, encodeKerberosTime(message.getClientTime())));
 		if (message.getClientMicroSecond() != null)
-			vector.add(new DERTaggedObject(3, new DERInteger(message.getClientMicroSecond().intValue())));
-		vector.add(new DERTaggedObject(4, encodeKerberosTime(message.getServerTime())));
-		vector.add(new DERTaggedObject(5, new DERInteger(message.getServerMicroSecond())));
-		vector.add(new DERTaggedObject(6, new DERInteger(message.getErrorCode())));
+			sequence.add(new DERTaggedObject(3, DERInteger.valueOf(message.getClientMicroSecond().intValue())));
+		sequence.add(new DERTaggedObject(4, encodeKerberosTime(message.getServerTime())));
+		sequence.add(new DERTaggedObject(5, DERInteger.valueOf(message.getServerMicroSecond())));
+		sequence.add(new DERTaggedObject(6, DERInteger.valueOf(message.getErrorCode())));
 		if (message.getClientPrincipal() != null)
-			vector.add(new DERTaggedObject(7, encodeRealm(message.getClientPrincipal().getRealm())));
+			sequence.add(new DERTaggedObject(7, encodeRealm(message.getClientPrincipal().getRealm())));
 		if (message.getClientPrincipal() != null)
-			vector.add(new DERTaggedObject(8, encodePrincipalName(message.getClientPrincipal())));
-		vector.add(new DERTaggedObject(9, encodeRealm(message.getServerPrincipal().getRealm())));
-		vector.add(new DERTaggedObject(10, encodePrincipalName(message.getServerPrincipal())));
+			sequence.add(new DERTaggedObject(8, encodePrincipalName(message.getClientPrincipal())));
+		sequence.add(new DERTaggedObject(9, encodeRealm(message.getServerPrincipal().getRealm())));
+		sequence.add(new DERTaggedObject(10, encodePrincipalName(message.getServerPrincipal())));
 		if (message.getExplanatoryText() != null)
-			vector.add(new DERTaggedObject(11, new DERGeneralString(message.getExplanatoryText())));
+			sequence.add(new DERTaggedObject(11, DERGeneralString.valueOf(message.getExplanatoryText())));
 		if (message.getExplanatoryData() != null)
-			vector.add(new DERTaggedObject(12, new DEROctetString(message.getExplanatoryData())));
+			sequence.add(new DERTaggedObject(12, new DEROctetString(message.getExplanatoryData())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReplyEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.IOException;
 import java.nio.ByteBuffer;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -41,7 +40,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream( newOutputStream( out ) );
 		
 		DERSequence kdcrep = encodeKdcReplySequence( app );
-		aos.writeObject( new DERApplicationSpecific( app.getMessageType().getOrdinal(), kdcrep ) );
+		aos.writeObject( DERApplicationSpecific.valueOf( app.getMessageType().getOrdinal(), kdcrep ) );
 		
 		aos.close();
 	}
@@ -58,18 +57,18 @@
 	}*/
 	private DERSequence encodeKdcReplySequence(KdcReply app) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(app.getProtocolVersionNumber())));
-		vector.add(new DERTaggedObject(1, new DERInteger(app.getMessageType().getOrdinal())));
+		sequence.add(new DERTaggedObject(0, DERInteger.valueOf(app.getProtocolVersionNumber())));
+		sequence.add(new DERTaggedObject(1, DERInteger.valueOf(app.getMessageType().getOrdinal())));
 		if (app.getPaData() != null)
-			vector.add(new DERTaggedObject(2, encodePaData(app.getPaData())));
-		vector.add(new DERTaggedObject(3, encodeRealm(app.getClientRealm())));
-		vector.add(new DERTaggedObject(4, encodePrincipalName(app.getClientPrincipal())));
-		vector.add(new DERTaggedObject(5, encodeTicket(app.getTicket())));
-		vector.add(new DERTaggedObject(6, encodeEncryptedData(app.getEncPart())));
+			sequence.add(new DERTaggedObject(2, encodePaData(app.getPaData())));
+		sequence.add(new DERTaggedObject(3, encodeRealm(app.getClientRealm())));
+		sequence.add(new DERTaggedObject(4, encodePrincipalName(app.getClientPrincipal())));
+		sequence.add(new DERTaggedObject(5, encodeTicket(app.getTicket())));
+		sequence.add(new DERTaggedObject(6, encodeEncryptedData(app.getEncPart())));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 
 	/*
@@ -80,17 +79,17 @@
 	}*/
 	private DERSequence encodePaData(PreAuthenticationData[] paData) {
 		
-		ASN1EncodableVector pa = new ASN1EncodableVector();
+		DERSequence pa = new DERSequence();
 		
 		for (int i = 0; i < paData.length; i++) {
-			ASN1EncodableVector vector = new ASN1EncodableVector();
+			DERSequence sequence = new DERSequence();
 
-			vector.add(new DERTaggedObject(1, new DERInteger(paData[i].getDataType().getOrdinal())));
-			vector.add(new DERTaggedObject(2, new DEROctetString(paData[i].getDataValue())));
-			pa.add(new DERSequence(vector));
+			sequence.add(new DERTaggedObject(1, DERInteger.valueOf(paData[i].getDataType().getOrdinal())));
+			sequence.add(new DERTaggedObject(2, new DEROctetString(paData[i].getDataValue())));
+			pa.add( sequence );
 		}
 		
-		return new DERSequence(pa);
+		return pa;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KdcReqBodyEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERInteger;
 import org.apache.asn1.der.DERSequence;
@@ -61,36 +60,36 @@
         additional-tickets[11]       SEQUENCE OF Ticket OPTIONAL
     }*/
 	private DERSequence encodeInitialSequence(KdcRequest request) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, encodeKdcOptions(request.getKdcOptions())));
+		sequence.add(new DERTaggedObject(0, encodeKdcOptions(request.getKdcOptions())));
 		// OPTIONAL
 		if (request.getClientPrincipal() != null)
-			vector.add(new DERTaggedObject(1, encodePrincipalName(request.getClientPrincipal())));
-		vector.add(new DERTaggedObject(2, encodeRealm(request.getRealm())));
+			sequence.add(new DERTaggedObject(1, encodePrincipalName(request.getClientPrincipal())));
+		sequence.add(new DERTaggedObject(2, encodeRealm(request.getRealm())));
 		// OPTIONAL
 		if (request.getServerPrincipal() != null)
-			vector.add(new DERTaggedObject(3, encodePrincipalName(request.getServerPrincipal())));
+			sequence.add(new DERTaggedObject(3, encodePrincipalName(request.getServerPrincipal())));
 		// OPTIONAL
 		if (request.getFrom() != null)
-			vector.add(new DERTaggedObject(4, encodeKerberosTime(request.getFrom())));
-		vector.add(new DERTaggedObject(5, encodeKerberosTime(request.getTill())));
+			sequence.add(new DERTaggedObject(4, encodeKerberosTime(request.getFrom())));
+		sequence.add(new DERTaggedObject(5, encodeKerberosTime(request.getTill())));
 		// OPTIONAL
 		if (request.getRtime() != null)
-			vector.add(new DERTaggedObject(6, encodeKerberosTime(request.getRtime())));
-		vector.add(new DERTaggedObject(7, new DERInteger(request.getNonce())));
-		vector.add(new DERTaggedObject(8, encodeEncryptionType(request.getEType())));
+			sequence.add(new DERTaggedObject(6, encodeKerberosTime(request.getRtime())));
+		sequence.add(new DERTaggedObject(7, DERInteger.valueOf(request.getNonce())));
+		sequence.add(new DERTaggedObject(8, encodeEncryptionType(request.getEType())));
 		// OPTIONAL
 		if (request.getAddresses() != null)
-			vector.add(new DERTaggedObject(9, encodeHostAddresses(request.getAddresses())));
+			sequence.add(new DERTaggedObject(9, encodeHostAddresses(request.getAddresses())));
 		// OPTIONAL
 		if (request.getEncAuthorizationData() != null)
-			vector.add(new DERTaggedObject(10, encodeEncryptedData(request.getEncAuthorizationData())));
+			sequence.add(new DERTaggedObject(10, encodeEncryptedData(request.getEncAuthorizationData())));
 		// OPTIONAL
 		if (request.getAdditionalTickets() != null)
-			vector.add(new DERTaggedObject(11, encodeAdditionalTickets(request.getAdditionalTickets())));
+			sequence.add(new DERTaggedObject(11, encodeAdditionalTickets(request.getAdditionalTickets())));
 
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java	Tue Jan 18 06:23:17 2005
@@ -26,7 +26,6 @@
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERBitString;
 import org.apache.asn1.der.DERGeneralString;
@@ -77,23 +76,23 @@
 	}*/
 	protected DERSequence encodePrincipalName(KerberosPrincipal principal) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(principal.getNameType())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(principal.getNameType())));
 		vector.add(new DERTaggedObject(1, encodeNameSequence(principal)));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	protected DERSequence encodeNameSequence(KerberosPrincipal principal) {
 		Iterator it = getNameStrings(principal).iterator();
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
 		while (it.hasNext())
-			vector.add(new DERGeneralString((String)it.next()));
+			vector.add( DERGeneralString.valueOf( (String)it.next() ));
 		
-		return new DERSequence(vector);
+		return vector;
 		
 	}
 	
@@ -116,16 +115,16 @@
     }*/
     protected DERApplicationSpecific encodeTicket(Ticket ticket) {
     	
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(ticket.getTicketVersionNumber())));
-		vector.add(new DERTaggedObject(1, new DERGeneralString(ticket.getRealm())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(ticket.getTicketVersionNumber())));
+		vector.add(new DERTaggedObject(1, DERGeneralString.valueOf( ticket.getRealm() )));
 		vector.add(new DERTaggedObject(2, encodePrincipalName(ticket.getServerPrincipal())));
 		vector.add(new DERTaggedObject(3, encodeEncryptedData(ticket.getEncPart())));
 		
 		DERApplicationSpecific ticketSequence = null;
 		try {
-			ticketSequence = new DERApplicationSpecific(1, new DERSequence(vector));
+			ticketSequence = DERApplicationSpecific.valueOf( 1, vector );
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
@@ -137,7 +136,7 @@
 	            -- Specifying UTC time zone (Z)
 	*/
     protected DERGeneralizedTime encodeKerberosTime(KerberosTime time) {
-    	return new DERGeneralizedTime(time.toDate());
+    	return DERGeneralizedTime.valueOf( time.toDate() );
     }
 	
 	/*
@@ -146,12 +145,12 @@
     */
 	protected DERSequence encodeEncryptionType(EncryptionType[] eType) {
 		
-		ASN1EncodableVector outerVector = new ASN1EncodableVector();
+		DERSequence outerVector = new DERSequence();
 		
 		for (int i = 0; i < eType.length; i++) {
-			outerVector.add(new DERInteger(eType[i].getOrdinal()));
+			outerVector.add(DERInteger.valueOf(eType[i].getOrdinal()));
 		}
-		return new DERSequence(outerVector);
+		return outerVector;
 	}
 	
 	/*
@@ -162,13 +161,13 @@
 	protected DERSequence encodeHostAddresses(HostAddresses hosts) {
 		
 		HostAddress[] addresses = hosts.getAddresses();
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
 		for (int i = 0; i < addresses.length; i++) {
 			vector.add(encodeHostAddress(addresses[i]));
 		}
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	/*
@@ -177,12 +176,12 @@
                         address[1]               OCTET STRING
     }*/
 	protected DERSequence encodeHostAddress(HostAddress host) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(host.getAddressType().getOrdinal())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(host.getAddressType().getOrdinal())));
 		vector.add(new DERTaggedObject(1, new DEROctetString(host.getAddress())));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	/*
@@ -192,27 +191,27 @@
 	            cipher[2]    OCTET STRING -- ciphertext
 	}*/
 	protected DERSequence encodeEncryptedData(EncryptedData encPart) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(encPart.getEncryptionType().getOrdinal())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(encPart.getEncryptionType().getOrdinal())));
 		if (encPart.getKeyVersion() > 0)
-			vector.add(new DERTaggedObject(1, new DERInteger(encPart.getKeyVersion())));
+			vector.add(new DERTaggedObject(1, DERInteger.valueOf(encPart.getKeyVersion())));
 		vector.add(new DERTaggedObject(2, new DEROctetString(encPart.getCipherText())));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	protected DERGeneralString encodeRealm(String realm) {
-		return new DERGeneralString(realm.toString());
+		return DERGeneralString.valueOf(realm.toString());
 	}
 	
 	protected DERSequence encodeEncryptionKey(EncryptionKey key) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(key.getKeyType().getOrdinal())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(key.getKeyType().getOrdinal())));
 		vector.add(new DERTaggedObject(1, new DEROctetString(key.getKeyValue())));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	/*
@@ -222,12 +221,12 @@
     }
 	*/
 	protected DERSequence encodeChecksum(Checksum checksum) {
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(checksum.getChecksumType().getOrdinal())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(checksum.getChecksumType().getOrdinal())));
 		vector.add(new DERTaggedObject(1, new DEROctetString(checksum.getChecksumValue())));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	/*
@@ -238,15 +237,15 @@
 	protected DERSequence encodeLastRequest(LastRequest lastReq) {
 
 		LastRequestEntry[] entries = lastReq.getEntries();
-		ASN1EncodableVector outerVector = new ASN1EncodableVector();
+		DERSequence outerVector = new DERSequence();
 		for (int i = 0; i < entries.length; i++) {
-			ASN1EncodableVector vector = new ASN1EncodableVector();
-			vector.add(new DERTaggedObject(0, new DERInteger(entries[i].getLastRequestType().getOrdinal())));
-			vector.add(new DERTaggedObject(1, new DERGeneralizedTime(entries[i].getLastRequestValue().toDate())));
-			outerVector.add(new DERSequence(vector));
+			DERSequence vector = new DERSequence();
+			vector.add(new DERTaggedObject(0, DERInteger.valueOf(entries[i].getLastRequestType().getOrdinal())));
+			vector.add(new DERTaggedObject(1, DERGeneralizedTime.valueOf(entries[i].getLastRequestValue().toDate())));
+			outerVector.add(vector);
 			}
 		
-		return new DERSequence(outerVector);
+		return outerVector;
 	}
 	
 	/*
@@ -309,12 +308,12 @@
     }*/
 	protected DERSequence encodeTransitedEncoding(TransitedEncoding te) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence vector = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(te.getType().getOrdinal())));
+		vector.add(new DERTaggedObject(0, DERInteger.valueOf(te.getType().getOrdinal())));
 		vector.add(new DERTaggedObject(1, new DEROctetString(te.getContents())));
 		
-		return new DERSequence(vector);
+		return vector;
 	}
 	
 	/*
@@ -325,28 +324,28 @@
 	protected DERSequence encodeAuthorizationData(AuthorizationData data) {
 		
 		Iterator it = data.iterator();
-		ASN1EncodableVector outerVector = new ASN1EncodableVector();
+		DERSequence outerVector = new DERSequence();
 		
 		while (it.hasNext()) {
 			AuthorizationDataEntry entry = (AuthorizationDataEntry)it.next();
-			ASN1EncodableVector vector = new ASN1EncodableVector();
-			vector.add(new DERTaggedObject(0, new DERInteger(entry.getAuthorizationDataType().getOrdinal())));
+			DERSequence vector = new DERSequence();
+			vector.add(new DERTaggedObject(0, DERInteger.valueOf(entry.getAuthorizationDataType().getOrdinal())));
 			vector.add(new DERTaggedObject(1, new DEROctetString(entry.getAuthorizationData())));
-			outerVector.add(new DERSequence(vector));
+			outerVector.add( vector );
 		}
-		return new DERSequence(outerVector);
+		return outerVector;
 	}
 	
 	protected DERSequence encodeAdditionalTickets(Ticket[] tickets) {
 
-		ASN1EncodableVector outerVector = new ASN1EncodableVector();
+		DERSequence outerVector = new DERSequence();
 
 		for (int i = 0; i < tickets.length; i++) {
-			ASN1EncodableVector vector = new ASN1EncodableVector();
+			DERSequence vector = new DERSequence();
 			vector.add(encodeTicket(tickets[i]));
-			outerVector.add(new DERSequence(vector));
+			outerVector.add( vector );
 		}
-		return new DERSequence(outerVector);
+		return outerVector;
 	}
 }
 

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java?view=diff&rev=125508&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java&r1=125507&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java&r2=125508
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java	(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/PrivateMessageEncoder.java	Tue Jan 18 06:23:17 2005
@@ -20,7 +20,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
-import org.apache.asn1.der.ASN1EncodableVector;
 import org.apache.asn1.der.ASN1OutputStream;
 import org.apache.asn1.der.DERApplicationSpecific;
 import org.apache.asn1.der.DERInteger;
@@ -35,7 +34,7 @@
 		ASN1OutputStream aos = new ASN1OutputStream(baos);
 		
 		DERSequence privateMessageSequence = encodePrivateMessageSequence(message);
-		aos.writeObject(new DERApplicationSpecific(message.getMessageType().getOrdinal(), privateMessageSequence));
+		aos.writeObject( DERApplicationSpecific.valueOf(message.getMessageType().getOrdinal(), privateMessageSequence));
 		aos.close();
 		
 		return baos.toByteArray();
@@ -43,13 +42,13 @@
 	
 	private DERSequence encodePrivateMessageSequence(PrivateMessage message) {
 		
-		ASN1EncodableVector vector = new ASN1EncodableVector();
+		DERSequence sequence = new DERSequence();
 		
-		vector.add(new DERTaggedObject(0, new DERInteger(message.getProtocolVersionNumber())));
-		vector.add(new DERTaggedObject(1, new DERInteger(message.getMessageType().getOrdinal())));
-		vector.add(new DERTaggedObject(3, encodeEncryptedData(message.getEncryptedPart())));
+		sequence.add(new DERTaggedObject(0, DERInteger.valueOf( message.getProtocolVersionNumber() )));
+		sequence.add(new DERTaggedObject(1, DERInteger.valueOf( message.getMessageType().getOrdinal() )));
+		sequence.add(new DERTaggedObject(3, encodeEncryptedData( message.getEncryptedPart() )));
 		
-		return new DERSequence(vector);
+		return sequence;
 	}
 }
 

Mime
View raw message