Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/ApOptions.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/ApOptions.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/ApOptions.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/ApOptions.java Fri Feb 10 02:48:07 2006
@@ -16,18 +16,20 @@
*/
package org.apache.kerberos.messages.value;
+
public class ApOptions extends Options
{
// AP Request option - reserved
- public static final int RESERVED = 0;
+ public static final int RESERVED = 0;
// AP Request option - use session key
- public static final int USE_SESSION_KEY = 1;
+ public static final int USE_SESSION_KEY = 1;
// AP Request option - mutual authentication required
- public static final int MUTUAL_REQUIRED = 2;
+ public static final int MUTUAL_REQUIRED = 2;
// AP Request option - maximum value
- public static final int MAX_VALUE = 32;
-
+ public static final int MAX_VALUE = 32;
+
+
/**
* Class constructors
*/
@@ -36,12 +38,14 @@
super( MAX_VALUE );
}
- public ApOptions( byte[] options )
+
+ public ApOptions(byte[] options)
{
super( MAX_VALUE );
setBytes( options );
}
+
/**
* Converts the object to a printable string
*/
@@ -53,17 +57,17 @@
{
result.append( "MUTUAL_REQUIRED " );
}
-
+
if ( get( RESERVED ) )
{
result.append( "RESERVED " );
}
-
+
if ( get( USE_SESSION_KEY ) )
{
result.append( "USE_SESSION_KEY " );
}
-
+
return result.toString().trim();
}
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationData.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationData.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationData.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationData.java Fri Feb 10 02:48:07 2006
@@ -16,16 +16,19 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.kerberos.messages.Encodable;
+
public class AuthorizationData implements Encodable
{
private List entries = new ArrayList();
+
/**
* Class constructor
*/
@@ -34,15 +37,18 @@
// used by ASN.1 decoder
}
+
public void add( AuthorizationData data )
{
entries.addAll( data.entries );
}
+
public void add( AuthorizationDataEntry entry )
{
entries.add( entry );
}
+
public Iterator iterator()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationDataEntry.java Fri Feb 10 02:48:07 2006
@@ -16,24 +16,28 @@
*/
package org.apache.kerberos.messages.value;
+
public class AuthorizationDataEntry
{
private AuthorizationType authorizationDataType;
- private byte[] authorizationData;
+ private byte[] authorizationData;
+
/**
* Class constructor
*/
- public AuthorizationDataEntry( AuthorizationType adType, byte[] adData )
+ public AuthorizationDataEntry(AuthorizationType adType, byte[] adData)
{
authorizationDataType = adType;
- authorizationData = adData;
+ authorizationData = adData;
}
+
public byte[] getAuthorizationData()
{
return authorizationData;
}
+
public AuthorizationType getAuthorizationDataType()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/AuthorizationType.java Fri Feb 10 02:48:07 2006
@@ -16,47 +16,56 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
public final class AuthorizationType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final AuthorizationType NULL = new AuthorizationType(0, "null");
- public static final AuthorizationType IF_RELEVANT = new AuthorizationType(1, "if relevant");
- public static final AuthorizationType INTENDED_FOR_SERVER = new AuthorizationType(2, "intended for server");
- public static final AuthorizationType INTENDED_FOR_APPLICATION_CLASS = new AuthorizationType(3, "intended for application class");
- public static final AuthorizationType KDC_ISSUED = new AuthorizationType(4, "kdc issued");
- public static final AuthorizationType OR = new AuthorizationType(5, "or");
- public static final AuthorizationType MANDATORY_TICKET_EXTENSIONS = new AuthorizationType(6, "mandatory ticket extensions");
- public static final AuthorizationType IN_TICKET_EXTENSIONS = new AuthorizationType(7, "in ticket extensions");
- public static final AuthorizationType OSF_DCE = new AuthorizationType(64, "OSF DCE");
- public static final AuthorizationType SESAME = new AuthorizationType(65, "sesame");
-
- public String toString()
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final AuthorizationType NULL = new AuthorizationType( 0, "null" );
+ public static final AuthorizationType IF_RELEVANT = new AuthorizationType( 1, "if relevant" );
+ public static final AuthorizationType INTENDED_FOR_SERVER = new AuthorizationType( 2, "intended for server" );
+ public static final AuthorizationType INTENDED_FOR_APPLICATION_CLASS = new AuthorizationType( 3,
+ "intended for application class" );
+ public static final AuthorizationType KDC_ISSUED = new AuthorizationType( 4, "kdc issued" );
+ public static final AuthorizationType OR = new AuthorizationType( 5, "or" );
+ public static final AuthorizationType MANDATORY_TICKET_EXTENSIONS = new AuthorizationType( 6,
+ "mandatory ticket extensions" );
+ public static final AuthorizationType IN_TICKET_EXTENSIONS = new AuthorizationType( 7, "in ticket extensions" );
+ public static final AuthorizationType OSF_DCE = new AuthorizationType( 64, "OSF DCE" );
+ public static final AuthorizationType SESAME = new AuthorizationType( 65, "sesame" );
+
+
+ public String toString()
{
return name + " (" + ordinal + ")";
}
+
public int compareTo( Object that )
{
- return ordinal - ( (AuthorizationType) that ).ordinal;
+ return ordinal - ( ( AuthorizationType ) that ).ordinal;
}
+
public static AuthorizationType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
{
- if ( values[ ii ].ordinal == type ) return values[ ii ];
+ if ( values[ii].ordinal == type )
+ return values[ii];
}
-
+
return NULL;
}
+
public int getOrdinal()
{
return ordinal;
@@ -66,10 +75,11 @@
private final String name;
private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private AuthorizationType( int ordinal, String name )
+ private AuthorizationType(int ordinal, String name)
{
this.ordinal = ordinal;
this.name = name;
@@ -78,9 +88,9 @@
/**
* These two lines are all that's necessary to export a List of VALUES.
*/
- private static final AuthorizationType[] values = { NULL, IF_RELEVANT, INTENDED_FOR_SERVER,
- INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR, MANDATORY_TICKET_EXTENSIONS,
- IN_TICKET_EXTENSIONS, OSF_DCE, SESAME };
+ private static final AuthorizationType[] values =
+ { NULL, IF_RELEVANT, INTENDED_FOR_SERVER, INTENDED_FOR_APPLICATION_CLASS, KDC_ISSUED, OR,
+ MANDATORY_TICKET_EXTENSIONS, IN_TICKET_EXTENSIONS, OSF_DCE, SESAME };
// VALUES needs to be located here, otherwise illegal forward reference
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Checksum.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Checksum.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Checksum.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Checksum.java Fri Feb 10 02:48:07 2006
@@ -16,21 +16,25 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import org.apache.kerberos.crypto.checksum.ChecksumType;
+
public class Checksum
{
private ChecksumType checksumType;
private byte[] checksum;
- public Checksum( ChecksumType checksumType, byte[] checksum )
+
+ public Checksum(ChecksumType checksumType, byte[] checksum)
{
this.checksumType = checksumType;
this.checksum = checksum;
}
+
public boolean equals( Object o )
{
if ( this == o )
@@ -43,16 +47,17 @@
return false;
}
- Checksum that = (Checksum) o;
+ Checksum that = ( Checksum ) o;
- return ( this.checksumType == that.checksumType )
- && ( Arrays.equals( this.checksum, that.checksum ) );
+ return ( this.checksumType == that.checksumType ) && ( Arrays.equals( this.checksum, that.checksum ) );
}
+
public byte[] getChecksumValue()
{
return checksum;
}
+
public ChecksumType getChecksumType()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedData.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedData.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedData.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedData.java Fri Feb 10 02:48:07 2006
@@ -16,30 +16,36 @@
*/
package org.apache.kerberos.messages.value;
+
import org.apache.kerberos.crypto.encryption.EncryptionType;
+
public class EncryptedData
{
- private EncryptionType encryptionType;
- private int keyVersion; //optional
- private byte[] cipherText;
+ private EncryptionType encryptionType;
+ private int keyVersion; //optional
+ private byte[] cipherText;
+
- public EncryptedData( EncryptionType type, int version, byte[] cipherText )
+ public EncryptedData(EncryptionType type, int version, byte[] cipherText)
{
- encryptionType = type;
- keyVersion = version;
+ encryptionType = type;
+ keyVersion = version;
this.cipherText = cipherText;
}
+
public EncryptionType getEncryptionType()
{
return encryptionType;
}
+
public int getKeyVersion()
{
return keyVersion;
}
+
public byte[] getCipherText()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedDataModifier.java Fri Feb 10 02:48:07 2006
@@ -16,28 +16,34 @@
*/
package org.apache.kerberos.messages.value;
+
import org.apache.kerberos.crypto.encryption.EncryptionType;
+
public class EncryptedDataModifier
{
- private EncryptionType encryptionType;
- private int keyVersion; //optional
- private byte[] cipherText;
-
- public EncryptedData getEncryptedData()
+ private EncryptionType encryptionType;
+ private int keyVersion; //optional
+ private byte[] cipherText;
+
+
+ public EncryptedData getEncryptedData()
{
return new EncryptedData( encryptionType, keyVersion, cipherText );
}
+
public void setCipherText( byte[] cipherText )
{
this.cipherText = cipherText;
}
+
public void setEncryptionType( EncryptionType type )
{
encryptionType = type;
}
+
public void setKeyVersion( int version )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStamp.java Fri Feb 10 02:48:07 2006
@@ -16,29 +16,34 @@
*/
package org.apache.kerberos.messages.value;
+
import org.apache.kerberos.messages.Encodable;
+
/**
* Pre-authentication encrypted timestamp
*/
public class EncryptedTimeStamp implements Encodable
{
- private KerberosTime timeStamp;
- private int microSeconds; //optional
+ private KerberosTime timeStamp;
+ private int microSeconds; //optional
+
+
+ public EncryptedTimeStamp(KerberosTime timeStamp, int microSeconds)
+ {
+ this.timeStamp = timeStamp;
+ this.microSeconds = microSeconds;
+ }
+
+
+ public KerberosTime getTimeStamp()
+ {
+ return timeStamp;
+ }
+
- public EncryptedTimeStamp( KerberosTime timeStamp, int microSeconds )
- {
- this.timeStamp = timeStamp;
- this.microSeconds = microSeconds;
- }
-
- public KerberosTime getTimeStamp()
- {
- return timeStamp;
- }
-
- public int getMicroSeconds()
- {
- return microSeconds;
- }
+ public int getMicroSeconds()
+ {
+ return microSeconds;
+ }
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptedTimeStampModifier.java Fri Feb 10 02:48:07 2006
@@ -16,20 +16,24 @@
*/
package org.apache.kerberos.messages.value;
+
public class EncryptedTimeStampModifier
{
- private KerberosTime timeStamp;
- private int microSecond; //optional
-
- public EncryptedTimeStamp getEncryptedTimestamp()
+ private KerberosTime timeStamp;
+ private int microSecond; //optional
+
+
+ public EncryptedTimeStamp getEncryptedTimestamp()
{
return new EncryptedTimeStamp( timeStamp, microSecond );
}
+
public void setKerberosTime( KerberosTime timeStamp )
{
this.timeStamp = timeStamp;
}
+
public void setMicroSecond( int microSecond )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionKey.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionKey.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionKey.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionKey.java Fri Feb 10 02:48:07 2006
@@ -16,23 +16,27 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import org.apache.kerberos.crypto.encryption.EncryptionType;
+
public class EncryptionKey
{
- private EncryptionType keyType;
- private byte[] keyValue;
- private int keyVersion;
-
- public EncryptionKey( EncryptionType keyType, byte[] keyValue )
+ private EncryptionType keyType;
+ private byte[] keyValue;
+ private int keyVersion;
+
+
+ public EncryptionKey(EncryptionType keyType, byte[] keyValue)
{
this.keyType = keyType;
this.keyValue = keyValue;
}
- public EncryptionKey( EncryptionType keyType, byte[] keyValue, int keyVersion )
+
+ public EncryptionKey(EncryptionType keyType, byte[] keyValue, int keyVersion)
{
this.keyType = keyType;
this.keyValue = keyValue;
@@ -47,48 +51,53 @@
this.keyVersion = keyVersion;
}
+
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
-
+
if ( !( o instanceof EncryptionKey ) )
{
return false;
}
- EncryptionKey that = (EncryptionKey) o;
- return ( this.keyType == that.keyType )
- && ( Arrays.equals( this.keyValue, that.keyValue ) );
+ EncryptionKey that = ( EncryptionKey ) o;
+ return ( this.keyType == that.keyType ) && ( Arrays.equals( this.keyValue, that.keyValue ) );
}
+
public synchronized void destroy()
{
if ( keyValue != null )
{
for ( int ii = 0; ii < keyValue.length; ii++ )
{
- keyValue[ ii ] = 0;
+ keyValue[ii] = 0;
}
}
}
+
public String toString()
{
return keyType.toString() + " (" + keyType.getOrdinal() + ")";
}
+
public EncryptionType getKeyType()
{
return keyType;
}
+
public byte[] getKeyValue()
{
return keyValue;
}
+
public int getKeyVersion()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/EncryptionTypeInfoEntry.java Fri Feb 10 02:48:07 2006
@@ -16,23 +16,28 @@
*/
package org.apache.kerberos.messages.value;
+
import org.apache.kerberos.crypto.encryption.EncryptionType;
+
public class EncryptionTypeInfoEntry
{
- private EncryptionType encryptionType;
- private byte[] salt;
+ private EncryptionType encryptionType;
+ private byte[] salt;
+
- public EncryptionTypeInfoEntry( EncryptionType encryptionType, byte[] salt )
+ public EncryptionTypeInfoEntry(EncryptionType encryptionType, byte[] salt)
{
this.encryptionType = encryptionType;
this.salt = salt;
}
+
public byte[] getSalt()
{
return salt;
}
+
public EncryptionType getEncryptionType()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddress.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddress.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddress.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddress.java Fri Feb 10 02:48:07 2006
@@ -16,9 +16,11 @@
*/
package org.apache.kerberos.messages.value;
+
import java.net.InetAddress;
import java.net.UnknownHostException;
+
/**
* Provides host address information.
*/
@@ -27,28 +29,30 @@
private HostAddressType addressType;
private byte[] address;
+
/**
* Class constructors
*/
- public HostAddress( HostAddressType addressType, byte[] address )
+ public HostAddress(HostAddressType addressType, byte[] address)
{
this.addressType = addressType;
this.address = address;
}
- public HostAddress( InetAddress internetAddress )
+
+ public HostAddress(InetAddress internetAddress)
{
addressType = HostAddressType.ADDRTYPE_INET;
byte[] newAddress = internetAddress.getAddress();
- address = new byte[ newAddress.length ];
+ address = new byte[newAddress.length];
System.arraycopy( newAddress, 0, address, 0, newAddress.length );
}
+
public boolean equals( HostAddress that )
{
- if ( this.addressType != that.addressType
- || ( this.address != null && that.address == null )
- || ( this.address == null && that.address != null ) )
+ if ( this.addressType != that.addressType || ( this.address != null && that.address == null )
+ || ( this.address == null && that.address != null ) )
{
return false;
}
@@ -62,7 +66,7 @@
for ( int ii = 0; ii < this.address.length; ii++ )
{
- if ( this.address[ ii ] != that.address[ ii ] )
+ if ( this.address[ii] != that.address[ii] )
{
return false;
}
@@ -72,15 +76,18 @@
return true;
}
+
public byte[] getAddress()
{
return address;
}
+
public HostAddressType getAddressType()
{
return addressType;
}
+
public String toString()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddressType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddressType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddressType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddressType.java Fri Feb 10 02:48:07 2006
@@ -16,87 +16,93 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
public final class HostAddressType implements Comparable
{
/**
* Enumeration elements are constructed once upon class loading.
* Order of appearance here determines the order of compareTo.
*/
- public static final HostAddressType NULL = new HostAddressType(0, "null");
- public static final HostAddressType ADDRTYPE_UNIX = new HostAddressType(1, "Unix");
- public static final HostAddressType ADDRTYPE_INET = new HostAddressType(2, "Internet");
- public static final HostAddressType ADDRTYPE_IMPLINK = new HostAddressType(3, "Arpanet");
- public static final HostAddressType ADDRTYPE_PUP = new HostAddressType(4, "PUP");
- public static final HostAddressType ADDRTYPE_CHAOS = new HostAddressType(5, "CHAOS");
- public static final HostAddressType ADDRTYPE_XNS = new HostAddressType(6, "XEROX Network Services");
- public static final HostAddressType ADDRTYPE_IPX = new HostAddressType(6, "IPX");
- public static final HostAddressType ADDRTYPE_OSI = new HostAddressType(7, "OSI");
- public static final HostAddressType ADDRTYPE_ECMA = new HostAddressType(8, "European Computer Manufacturers");
- public static final HostAddressType ADDRTYPE_DATAKIT = new HostAddressType(9, "Datakit");
- public static final HostAddressType ADDRTYPE_CCITT = new HostAddressType(10, "CCITT");
- public static final HostAddressType ADDRTYPE_SNA = new HostAddressType(11, "SNA");
- public static final HostAddressType ADDRTYPE_DECNET = new HostAddressType(12, "DECnet");
- public static final HostAddressType ADDRTYPE_DLI = new HostAddressType(13, "Direct Data Link Interface");
- public static final HostAddressType ADDRTYPE_LAT = new HostAddressType(14, "LAT");
- public static final HostAddressType ADDRTYPE_HYLINK = new HostAddressType(15, "NSC Hyperchannel");
- public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType(16, "AppleTalk");
- public static final HostAddressType ADDRTYPE_NETBIOS = new HostAddressType(17, "NetBios");
- public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType(18, "VoiceView");
- public static final HostAddressType ADDRTYPE_FIREFOX = new HostAddressType(19, "Firefox");
- public static final HostAddressType ADDRTYPE_BAN = new HostAddressType(21, "Banyan");
- public static final HostAddressType ADDRTYPE_ATM = new HostAddressType(22, "ATM");
- public static final HostAddressType ADDRTYPE_INET6 = new HostAddressType(23, "Internet Protocol V6");
+ public static final HostAddressType NULL = new HostAddressType( 0, "null" );
+ public static final HostAddressType ADDRTYPE_UNIX = new HostAddressType( 1, "Unix" );
+ public static final HostAddressType ADDRTYPE_INET = new HostAddressType( 2, "Internet" );
+ public static final HostAddressType ADDRTYPE_IMPLINK = new HostAddressType( 3, "Arpanet" );
+ public static final HostAddressType ADDRTYPE_PUP = new HostAddressType( 4, "PUP" );
+ public static final HostAddressType ADDRTYPE_CHAOS = new HostAddressType( 5, "CHAOS" );
+ public static final HostAddressType ADDRTYPE_XNS = new HostAddressType( 6, "XEROX Network Services" );
+ public static final HostAddressType ADDRTYPE_IPX = new HostAddressType( 6, "IPX" );
+ public static final HostAddressType ADDRTYPE_OSI = new HostAddressType( 7, "OSI" );
+ public static final HostAddressType ADDRTYPE_ECMA = new HostAddressType( 8, "European Computer Manufacturers" );
+ public static final HostAddressType ADDRTYPE_DATAKIT = new HostAddressType( 9, "Datakit" );
+ public static final HostAddressType ADDRTYPE_CCITT = new HostAddressType( 10, "CCITT" );
+ public static final HostAddressType ADDRTYPE_SNA = new HostAddressType( 11, "SNA" );
+ public static final HostAddressType ADDRTYPE_DECNET = new HostAddressType( 12, "DECnet" );
+ public static final HostAddressType ADDRTYPE_DLI = new HostAddressType( 13, "Direct Data Link Interface" );
+ public static final HostAddressType ADDRTYPE_LAT = new HostAddressType( 14, "LAT" );
+ public static final HostAddressType ADDRTYPE_HYLINK = new HostAddressType( 15, "NSC Hyperchannel" );
+ public static final HostAddressType ADDRTYPE_APPLETALK = new HostAddressType( 16, "AppleTalk" );
+ public static final HostAddressType ADDRTYPE_NETBIOS = new HostAddressType( 17, "NetBios" );
+ public static final HostAddressType ADDRTYPE_VOICEVIEW = new HostAddressType( 18, "VoiceView" );
+ public static final HostAddressType ADDRTYPE_FIREFOX = new HostAddressType( 19, "Firefox" );
+ public static final HostAddressType ADDRTYPE_BAN = new HostAddressType( 21, "Banyan" );
+ public static final HostAddressType ADDRTYPE_ATM = new HostAddressType( 22, "ATM" );
+ public static final HostAddressType ADDRTYPE_INET6 = new HostAddressType( 23, "Internet Protocol V6" );
/**
* These two lines are all that's necessary to export a List of VALUES.
*/
- private static final HostAddressType[] values = { NULL, ADDRTYPE_UNIX, ADDRTYPE_INET,
- ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS, ADDRTYPE_IPX,
- ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA,
- ADDRTYPE_DECNET, ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK,
- ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW, ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM,
- ADDRTYPE_INET6 };
+ private static final HostAddressType[] values =
+ { NULL, ADDRTYPE_UNIX, ADDRTYPE_INET, ADDRTYPE_IMPLINK, ADDRTYPE_PUP, ADDRTYPE_CHAOS, ADDRTYPE_XNS,
+ ADDRTYPE_IPX, ADDRTYPE_OSI, ADDRTYPE_ECMA, ADDRTYPE_DATAKIT, ADDRTYPE_CCITT, ADDRTYPE_SNA, ADDRTYPE_DECNET,
+ ADDRTYPE_DLI, ADDRTYPE_LAT, ADDRTYPE_HYLINK, ADDRTYPE_APPLETALK, ADDRTYPE_NETBIOS, ADDRTYPE_VOICEVIEW,
+ ADDRTYPE_FIREFOX, ADDRTYPE_BAN, ADDRTYPE_ATM, ADDRTYPE_INET6 };
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
private final String name;
private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private HostAddressType( int ordinal, String name )
+ private HostAddressType(int ordinal, String name)
{
this.ordinal = ordinal;
this.name = name;
}
+
public String toString()
{
return name + " (" + ordinal + ")";
}
+
public int compareTo( Object that )
{
- return ordinal - ( (HostAddressType) that ).ordinal;
+ return ordinal - ( ( HostAddressType ) that ).ordinal;
}
+
public static HostAddressType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
{
- if ( values[ ii ].ordinal == type )
+ if ( values[ii].ordinal == type )
{
- return values[ ii ];
+ return values[ii];
}
}
return NULL;
}
+
public int getOrdinal()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddresses.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddresses.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddresses.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/HostAddresses.java Fri Feb 10 02:48:07 2006
@@ -16,25 +16,28 @@
*/
package org.apache.kerberos.messages.value;
+
public class HostAddresses
{
private HostAddress[] addresses;
+
/**
* Class constructors
*/
- public HostAddresses( HostAddress[] addresses )
+ public HostAddresses(HostAddress[] addresses)
{
this.addresses = addresses;
}
+
public boolean contains( HostAddress address )
{
if ( addresses != null )
{
for ( int ii = 0; ii < addresses.length; ii++ )
{
- if ( addresses[ ii ].equals( address ) )
+ if ( addresses[ii].equals( address ) )
{
return true;
}
@@ -44,10 +47,11 @@
return false;
}
+
public boolean equals( HostAddresses that )
{
if ( ( this.addresses == null && that.addresses != null )
- || ( this.addresses != null && that.addresses == null ) )
+ || ( this.addresses != null && that.addresses == null ) )
{
return false;
}
@@ -61,7 +65,7 @@
for ( int ii = 0; ii < this.addresses.length; ii++ )
{
- if ( !this.addresses[ ii ].equals( that.addresses[ ii ] ) )
+ if ( !this.addresses[ii].equals( that.addresses[ii] ) )
{
return false;
}
@@ -71,18 +75,20 @@
return true;
}
+
public HostAddress[] getAddresses()
{
return addresses;
}
+
public String toString()
{
StringBuffer sb = new StringBuffer();
for ( int ii = 0; ii < this.addresses.length; ii++ )
{
- sb.append( addresses[ ii ].toString() );
+ sb.append( addresses[ii].toString() );
if ( ii < addresses.length - 1 )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KdcOptions.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KdcOptions.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KdcOptions.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KdcOptions.java Fri Feb 10 02:48:07 2006
@@ -16,51 +16,53 @@
*/
package org.apache.kerberos.messages.value;
+
public class KdcOptions extends Options
{
// KDC option - reserved
- public static final int RESERVED = 0;
+ public static final int RESERVED = 0;
// KDC option - forwardable
- public static final int FORWARDABLE = 1;
+ public static final int FORWARDABLE = 1;
// KDC option - forwarded
- public static final int FORWARDED = 2;
+ public static final int FORWARDED = 2;
// KDC option - proxiable
- public static final int PROXIABLE = 3;
+ public static final int PROXIABLE = 3;
// KDC option - proxy
- public static final int PROXY = 4;
+ public static final int PROXY = 4;
// KDC option - allow postdate
- public static final int ALLOW_POSTDATE = 5;
+ public static final int ALLOW_POSTDATE = 5;
// KDC option - postdated
- public static final int POSTDATED = 6;
+ public static final int POSTDATED = 6;
// KDC option - unused7
- public static final int UNUSED7 = 7;
+ public static final int UNUSED7 = 7;
// KDC option - renewable
- public static final int RENEWABLE = 8;
+ public static final int RENEWABLE = 8;
// KDC option - unused9
- public static final int UNUSED9 = 9;
+ public static final int UNUSED9 = 9;
// KDC option - unused10
- public static final int UNUSED10 = 10;
+ public static final int UNUSED10 = 10;
// KDC option - unused11
- public static final int UNUSED11 = 11;
+ public static final int UNUSED11 = 11;
// KDC option - unused12
- public static final int UNUSED12 = 12;
+ public static final int UNUSED12 = 12;
// KDC option - unused13
- public static final int UNUSED13 = 13;
+ public static final int UNUSED13 = 13;
// KDC option - disable transisted checked
- public static final int DISABLE_TRANSISTED_CHECKED = 26;
+ public static final int DISABLE_TRANSISTED_CHECKED = 26;
// KDC option - renewable is ok
- public static final int RENEWABLE_OK = 27;
+ public static final int RENEWABLE_OK = 27;
// KDC option - encrypted key in skey
- public static final int ENC_TKT_IN_SKEY = 28;
+ public static final int ENC_TKT_IN_SKEY = 28;
// KDC option - renew
- public static final int RENEW = 30;
+ public static final int RENEW = 30;
// KDC option - validate
- public static final int VALIDATE = 31;
+ public static final int VALIDATE = 31;
// KDC option - maximum value
- public static final int MAX_VALUE = 32;
+ public static final int MAX_VALUE = 32;
+
- /**
+ /**
* Class constructors
*/
public KdcOptions()
@@ -68,11 +70,13 @@
super( MAX_VALUE );
}
- public KdcOptions( byte[] bytes )
+
+ public KdcOptions(byte[] bytes)
{
super( MAX_VALUE );
setBytes( bytes );
}
+
/**
* Converts the object to a printable string
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosPrincipalModifier.java Fri Feb 10 02:48:07 2006
@@ -16,8 +16,10 @@
*/
package org.apache.kerberos.messages.value;
+
import javax.security.auth.kerberos.KerberosPrincipal;
+
public class KerberosPrincipalModifier
{
private static final String REALM_SEPARATOR = "@";
@@ -25,6 +27,7 @@
PrincipalName nameComponent;
String realm;
+
public KerberosPrincipal getKerberosPrincipal()
{
if ( nameComponent != null )
@@ -44,10 +47,12 @@
return null;
}
+
public void setPrincipalName( PrincipalName principalName )
{
nameComponent = principalName;
}
+
public void setRealm( String realm )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosTime.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosTime.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosTime.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KerberosTime.java Fri Feb 10 02:48:07 2006
@@ -16,10 +16,12 @@
*/
package org.apache.kerberos.messages.value;
+
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
+
/**
* Implementation of the time object for Kerberos
*/
@@ -37,21 +39,25 @@
private long kerberosTime;
+
public KerberosTime()
{
kerberosTime = System.currentTimeMillis();
}
- public KerberosTime( long time )
+
+ public KerberosTime(long time)
{
kerberosTime = time;
}
- public KerberosTime( Date time )
+
+ public KerberosTime(Date time)
{
kerberosTime = time.getTime();
}
+
public int compareTo( Object o )
{
final int BEFORE = -1;
@@ -67,7 +73,7 @@
// Performing explicit checks for nullity and type are made redundant by
// the following cast, which will throw NullPointerException and
// ClassCastException in these respective cases.
- final KerberosTime that = (KerberosTime) o;
+ final KerberosTime that = ( KerberosTime ) o;
// primitive numbers follow this form
if ( this.kerberosTime < that.kerberosTime )
@@ -83,48 +89,56 @@
return EQUAL;
}
+
public long getTime()
{
return kerberosTime;
}
+
public Date toDate()
{
return new Date( kerberosTime );
}
+
public boolean isInClockSkew( long clockSkew )
{
return Math.abs( kerberosTime - System.currentTimeMillis() ) < clockSkew;
}
+
public boolean greaterThan( KerberosTime time )
{
return kerberosTime > time.kerberosTime;
}
+
public boolean lessThan( KerberosTime time )
{
return kerberosTime < time.kerberosTime;
}
+
public boolean equals( KerberosTime time )
{
return kerberosTime == time.kerberosTime;
}
+
public boolean isZero()
{
return kerberosTime == 0;
}
+
public String toString()
{
- Date kerberosDate = new Date( kerberosTime );
-
- synchronized (dateFormat)
- {
- return dateFormat.format( kerberosDate );
- }
+ Date kerberosDate = new Date( kerberosTime );
+
+ synchronized ( dateFormat )
+ {
+ return dateFormat.format( kerberosDate );
+ }
}
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KrbCredInfo.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KrbCredInfo.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KrbCredInfo.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/KrbCredInfo.java Fri Feb 10 02:48:07 2006
@@ -16,77 +16,89 @@
*/
package org.apache.kerberos.messages.value;
+
import javax.security.auth.kerberos.KerberosPrincipal;
+
/**
* Kerberos credential information
*/
public class KrbCredInfo
{
- private EncryptionKey key;
- private KerberosPrincipal clientPrincipal; //optional
- private TicketFlags flags; //optional
- private KerberosTime authTime; //optional
- private KerberosTime startTime; //optional
- private KerberosTime endTime; //optional
- private KerberosTime renewTill; //optional
- private KerberosPrincipal serverPrincipal; //optional
- private HostAddresses clientAddresses; //optional
-
- public KrbCredInfo( EncryptionKey key, KerberosPrincipal clientPrincipal, TicketFlags flags,
- KerberosTime authTime, KerberosTime startTime, KerberosTime endTime,
- KerberosTime renewTill, KerberosPrincipal serverPrincipal, HostAddresses clientAddresses )
+ private EncryptionKey key;
+ private KerberosPrincipal clientPrincipal; //optional
+ private TicketFlags flags; //optional
+ private KerberosTime authTime; //optional
+ private KerberosTime startTime; //optional
+ private KerberosTime endTime; //optional
+ private KerberosTime renewTill; //optional
+ private KerberosPrincipal serverPrincipal; //optional
+ private HostAddresses clientAddresses; //optional
+
+
+ public KrbCredInfo(EncryptionKey key, KerberosPrincipal clientPrincipal, TicketFlags flags, KerberosTime authTime,
+ KerberosTime startTime, KerberosTime endTime, KerberosTime renewTill, KerberosPrincipal serverPrincipal,
+ HostAddresses clientAddresses)
{
- this.key = key;
+ this.key = key;
this.clientPrincipal = clientPrincipal;
- this.flags = flags;
- this.authTime = authTime;
- this.startTime = startTime;
- this.endTime = endTime;
- this.renewTill = renewTill;
+ this.flags = flags;
+ this.authTime = authTime;
+ this.startTime = startTime;
+ this.endTime = endTime;
+ this.renewTill = renewTill;
this.serverPrincipal = serverPrincipal;
this.clientAddresses = clientAddresses;
}
+
public KerberosTime getAuthTime()
{
return authTime;
}
+
public HostAddresses getClientAddresses()
{
return clientAddresses;
}
+
public KerberosTime getEndTime()
{
return endTime;
}
+
public TicketFlags getFlags()
{
return flags;
}
+
public EncryptionKey getKey()
{
return key;
}
+
public KerberosPrincipal getClientPrincipal()
{
return clientPrincipal;
}
+
public KerberosTime getRenewTill()
{
return renewTill;
}
+
public KerberosPrincipal getServerPrincipal()
{
return serverPrincipal;
}
+
public KerberosTime getStartTime()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequest.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequest.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequest.java Fri Feb 10 02:48:07 2006
@@ -16,19 +16,23 @@
*/
package org.apache.kerberos.messages.value;
+
public class LastRequest
{
- private LastRequestEntry[] entries = new LastRequestEntry[ 1 ];
+ private LastRequestEntry[] entries = new LastRequestEntry[1];
+
public LastRequest()
{
- entries[ 0 ] = new LastRequestEntry( LastRequestType.NONE, new KerberosTime() );
+ entries[0] = new LastRequestEntry( LastRequestType.NONE, new KerberosTime() );
}
- public LastRequest( LastRequestEntry[] entries )
+
+ public LastRequest(LastRequestEntry[] entries)
{
this.entries = entries;
}
+
public LastRequestEntry[] getEntries()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestEntry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestEntry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestEntry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestEntry.java Fri Feb 10 02:48:07 2006
@@ -16,21 +16,25 @@
*/
package org.apache.kerberos.messages.value;
+
public class LastRequestEntry
{
private LastRequestType lastRequestType;
private KerberosTime lastRequestValue;
- public LastRequestEntry( LastRequestType type, KerberosTime value )
+
+ public LastRequestEntry(LastRequestType type, KerberosTime value)
{
lastRequestType = type;
lastRequestValue = value;
}
+
public LastRequestType getLastRequestType()
{
return lastRequestType;
}
+
public KerberosTime getLastRequestValue()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/LastRequestType.java Fri Feb 10 02:48:07 2006
@@ -16,47 +16,53 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
public final class LastRequestType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final LastRequestType NONE = new LastRequestType(0, "none");
- public static final LastRequestType TIME_OF_INITIAL_TGT = new LastRequestType(1, "time of initial ticket");
- public static final LastRequestType TIME_OF_INITIAL_REQ = new LastRequestType(2, "time of initial request");
- public static final LastRequestType TIME_OF_NEWEST_TGT = new LastRequestType(3, "time of newest ticket");
- public static final LastRequestType TIME_OF_LAST_RENEWAL = new LastRequestType(4, "time of last renewal");
- public static final LastRequestType TIME_OF_LAST_REQ = new LastRequestType(5, "time of last request");
- public static final LastRequestType TIME_OF_PASSWORD_EXP = new LastRequestType(6, "time of password expiration");
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final LastRequestType NONE = new LastRequestType( 0, "none" );
+ public static final LastRequestType TIME_OF_INITIAL_TGT = new LastRequestType( 1, "time of initial ticket" );
+ public static final LastRequestType TIME_OF_INITIAL_REQ = new LastRequestType( 2, "time of initial request" );
+ public static final LastRequestType TIME_OF_NEWEST_TGT = new LastRequestType( 3, "time of newest ticket" );
+ public static final LastRequestType TIME_OF_LAST_RENEWAL = new LastRequestType( 4, "time of last renewal" );
+ public static final LastRequestType TIME_OF_LAST_REQ = new LastRequestType( 5, "time of last request" );
+ public static final LastRequestType TIME_OF_PASSWORD_EXP = new LastRequestType( 6, "time of password expiration" );
+
- public String toString()
+ public String toString()
{
return name + " (" + ordinal + ")";
}
+
public int compareTo( Object that )
{
- return ordinal - ( (LastRequestType) that ).ordinal;
+ return ordinal - ( ( LastRequestType ) that ).ordinal;
}
+
public static LastRequestType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
{
- if ( values[ ii ].ordinal == type )
+ if ( values[ii].ordinal == type )
{
- return values[ ii ];
+ return values[ii];
}
}
return NONE;
}
+
public int getOrdinal()
{
return ordinal;
@@ -66,10 +72,11 @@
private final String name;
private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private LastRequestType( int ordinal, String name )
+ private LastRequestType(int ordinal, String name)
{
this.ordinal = ordinal;
this.name = name;
@@ -78,8 +85,8 @@
/**
* These two lines are all that's necessary to export a List of VALUES.
*/
- private static final LastRequestType[] values = { NONE, TIME_OF_INITIAL_TGT,
- TIME_OF_INITIAL_REQ, TIME_OF_NEWEST_TGT, TIME_OF_LAST_RENEWAL, TIME_OF_LAST_REQ,
+ private static final LastRequestType[] values =
+ { NONE, TIME_OF_INITIAL_TGT, TIME_OF_INITIAL_REQ, TIME_OF_NEWEST_TGT, TIME_OF_LAST_RENEWAL, TIME_OF_LAST_REQ,
TIME_OF_PASSWORD_EXP };
// VALUES needs to be located here, otherwise illegal forward reference
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Options.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Options.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Options.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/Options.java Fri Feb 10 02:48:07 2006
@@ -16,39 +16,47 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.BitSet;
+
public abstract class Options
{
- private BitSet options;
+ private BitSet options;
private int maxSize;
- protected Options( int maxSize )
+
+ protected Options(int maxSize)
{
this.maxSize = maxSize;
options = new BitSet( maxSize );
}
+
public boolean match( Options options, int option )
{
return options.get( option ) == this.get( option );
}
+
public boolean get( int index )
{
return options.get( index );
}
+
public void set( int index )
{
options.set( index );
}
+
public void clear( int index )
{
options.clear( index );
}
+
/*
* Byte-reversing methods are an anomaly of the BouncyCastle
* DERBitString endianness. Thes methods can be removed if the
@@ -56,28 +64,30 @@
*/
public byte[] getBytes()
{
- byte[] bytes = new byte[ maxSize / 8 ];
-
+ byte[] bytes = new byte[maxSize / 8];
+
for ( int ii = 0; ii < maxSize; ii++ )
{
if ( options.get( reversePosition( ii ) ) )
{
- bytes[ bytes.length - ii / 8 - 1 ] |= 1 << ( ii % 8 );
+ bytes[bytes.length - ii / 8 - 1] |= 1 << ( ii % 8 );
}
}
return bytes;
}
+
protected void setBytes( byte[] bytes )
{
for ( int ii = 0; ii < bytes.length * 8; ii++ )
{
- if ( ( bytes[ bytes.length - ii / 8 - 1 ] & ( 1 << ( ii % 8 ) ) ) > 0 )
+ if ( ( bytes[bytes.length - ii / 8 - 1] & ( 1 << ( ii % 8 ) ) ) > 0 )
{
options.set( reversePosition( ii ) );
}
}
}
+
private int reversePosition( int position )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationData.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationData.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationData.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationData.java Fri Feb 10 02:48:07 2006
@@ -16,21 +16,25 @@
*/
package org.apache.kerberos.messages.value;
+
public class PreAuthenticationData
{
private PreAuthenticationDataType dataType;
private byte[] dataValue;
- public PreAuthenticationData( PreAuthenticationDataType dataType, byte[] dataValue )
+
+ public PreAuthenticationData(PreAuthenticationDataType dataType, byte[] dataValue)
{
this.dataType = dataType;
this.dataValue = dataValue;
}
+
public PreAuthenticationDataType getDataType()
{
return dataType;
}
+
public byte[] getDataValue()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataModifier.java Fri Feb 10 02:48:07 2006
@@ -16,20 +16,24 @@
*/
package org.apache.kerberos.messages.value;
+
public class PreAuthenticationDataModifier
{
private PreAuthenticationDataType dataType;
private byte[] dataValue;
+
public PreAuthenticationData getPreAuthenticationData()
{
return new PreAuthenticationData( dataType, dataValue );
}
+
public void setDataType( PreAuthenticationDataType dataType )
{
this.dataType = dataType;
}
+
public void setDataValue( byte[] dataValue )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PreAuthenticationDataType.java Fri Feb 10 02:48:07 2006
@@ -16,40 +16,48 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
public class PreAuthenticationDataType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final PreAuthenticationDataType NULL = new PreAuthenticationDataType( 0, "null" );
- public static final PreAuthenticationDataType PA_TGS_REQ = new PreAuthenticationDataType( 1, "TGS Request." );
- public static final PreAuthenticationDataType PA_ENC_TIMESTAMP = new PreAuthenticationDataType( 2, "Encrypted timestamp." );
- public static final PreAuthenticationDataType PA_PW_SALT = new PreAuthenticationDataType( 3, "password salt" );
- public static final PreAuthenticationDataType PA_ENC_UNIX_TIME = new PreAuthenticationDataType( 5, "enc unix time" );
- public static final PreAuthenticationDataType PA_SANDIA_SECUREID = new PreAuthenticationDataType( 6, "sandia secureid" );
- public static final PreAuthenticationDataType PA_SESAME = new PreAuthenticationDataType( 7, "sesame" );
- public static final PreAuthenticationDataType PA_OSF_DCE = new PreAuthenticationDataType( 8, "OSF DCE" );
- public static final PreAuthenticationDataType PA_CYBERSAFE_SECUREID = new PreAuthenticationDataType( 9, "cybersafe secureid" );
- public static final PreAuthenticationDataType PA_ASF3_SALT = new PreAuthenticationDataType( 10, "ASF3 salt" );
- public static final PreAuthenticationDataType PA_ENCTYPE_INFO = new PreAuthenticationDataType( 11, "Encryption info." );
- public static final PreAuthenticationDataType SAM_CHALLENGE = new PreAuthenticationDataType( 12, "SAM challenge." );
- public static final PreAuthenticationDataType SAM_RESPONSE = new PreAuthenticationDataType( 13, "SAM response." );
- public static final PreAuthenticationDataType PA_PK_AS_REQ = new PreAuthenticationDataType( 14, "PK as request" );
- public static final PreAuthenticationDataType PA_PK_AS_REP = new PreAuthenticationDataType( 15, "PK as response" );
- public static final PreAuthenticationDataType PA_USE_SPECIFIED_KVNO = new PreAuthenticationDataType( 20, "use specified key version" );
- public static final PreAuthenticationDataType SAM_REDIRECT = new PreAuthenticationDataType( 21, "SAM redirect." );
- public static final PreAuthenticationDataType PA_GET_FROM_TYPED_DATA = new PreAuthenticationDataType( 22, "Get from typed data" );
-
- /** Array for building a List of VALUES. */
- private static final PreAuthenticationDataType[] values = { NULL, PA_TGS_REQ, PA_ENC_TIMESTAMP,
- PA_PW_SALT, PA_ENC_UNIX_TIME, PA_SANDIA_SECUREID, PA_SESAME, PA_OSF_DCE,
- PA_CYBERSAFE_SECUREID, PA_ASF3_SALT, PA_ENCTYPE_INFO, SAM_CHALLENGE, SAM_RESPONSE,
- PA_PK_AS_REQ, PA_PK_AS_REP, PA_USE_SPECIFIED_KVNO, SAM_REDIRECT, PA_GET_FROM_TYPED_DATA };
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final PreAuthenticationDataType NULL = new PreAuthenticationDataType( 0, "null" );
+ public static final PreAuthenticationDataType PA_TGS_REQ = new PreAuthenticationDataType( 1, "TGS Request." );
+ public static final PreAuthenticationDataType PA_ENC_TIMESTAMP = new PreAuthenticationDataType( 2,
+ "Encrypted timestamp." );
+ public static final PreAuthenticationDataType PA_PW_SALT = new PreAuthenticationDataType( 3, "password salt" );
+ public static final PreAuthenticationDataType PA_ENC_UNIX_TIME = new PreAuthenticationDataType( 5, "enc unix time" );
+ public static final PreAuthenticationDataType PA_SANDIA_SECUREID = new PreAuthenticationDataType( 6,
+ "sandia secureid" );
+ public static final PreAuthenticationDataType PA_SESAME = new PreAuthenticationDataType( 7, "sesame" );
+ public static final PreAuthenticationDataType PA_OSF_DCE = new PreAuthenticationDataType( 8, "OSF DCE" );
+ public static final PreAuthenticationDataType PA_CYBERSAFE_SECUREID = new PreAuthenticationDataType( 9,
+ "cybersafe secureid" );
+ public static final PreAuthenticationDataType PA_ASF3_SALT = new PreAuthenticationDataType( 10, "ASF3 salt" );
+ public static final PreAuthenticationDataType PA_ENCTYPE_INFO = new PreAuthenticationDataType( 11,
+ "Encryption info." );
+ public static final PreAuthenticationDataType SAM_CHALLENGE = new PreAuthenticationDataType( 12, "SAM challenge." );
+ public static final PreAuthenticationDataType SAM_RESPONSE = new PreAuthenticationDataType( 13, "SAM response." );
+ public static final PreAuthenticationDataType PA_PK_AS_REQ = new PreAuthenticationDataType( 14, "PK as request" );
+ public static final PreAuthenticationDataType PA_PK_AS_REP = new PreAuthenticationDataType( 15, "PK as response" );
+ public static final PreAuthenticationDataType PA_USE_SPECIFIED_KVNO = new PreAuthenticationDataType( 20,
+ "use specified key version" );
+ public static final PreAuthenticationDataType SAM_REDIRECT = new PreAuthenticationDataType( 21, "SAM redirect." );
+ public static final PreAuthenticationDataType PA_GET_FROM_TYPED_DATA = new PreAuthenticationDataType( 22,
+ "Get from typed data" );
+
+ /** Array for building a List of VALUES. */
+ private static final PreAuthenticationDataType[] values =
+ { NULL, PA_TGS_REQ, PA_ENC_TIMESTAMP, PA_PW_SALT, PA_ENC_UNIX_TIME, PA_SANDIA_SECUREID, PA_SESAME, PA_OSF_DCE,
+ PA_CYBERSAFE_SECUREID, PA_ASF3_SALT, PA_ENCTYPE_INFO, SAM_CHALLENGE, SAM_RESPONSE, PA_PK_AS_REQ,
+ PA_PK_AS_REP, PA_USE_SPECIFIED_KVNO, SAM_REDIRECT, PA_GET_FROM_TYPED_DATA };
/** A list of all the pre-authentication type constants. */
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
@@ -60,37 +68,42 @@
/** The value/code for the pre-authentication type. */
private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private PreAuthenticationDataType( int ordinal, String name )
+ private PreAuthenticationDataType(int ordinal, String name)
{
this.ordinal = ordinal;
this.name = name;
}
+
public String toString()
{
return name + " (" + ordinal + ")";
}
+
public int compareTo( Object that )
{
- return ordinal - ( (PreAuthenticationDataType) that ).ordinal;
+ return ordinal - ( ( PreAuthenticationDataType ) that ).ordinal;
}
+
public static PreAuthenticationDataType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
{
- if ( values[ ii ].ordinal == type )
+ if ( values[ii].ordinal == type )
{
- return values[ ii ];
+ return values[ii];
}
}
return NULL;
}
+
public int getOrdinal()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalName.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalName.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalName.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalName.java Fri Feb 10 02:48:07 2006
@@ -16,21 +16,25 @@
*/
package org.apache.kerberos.messages.value;
+
public class PrincipalName
{
private String nameComponent;
private int nameType;
- public PrincipalName( String nameComponent, int nameType )
+
+ public PrincipalName(String nameComponent, int nameType)
{
this.nameComponent = nameComponent;
this.nameType = nameType;
}
+
public int getNameType()
{
return nameType;
}
+
public String getNameComponent()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameModifier.java Fri Feb 10 02:48:07 2006
@@ -16,10 +16,12 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+
public class PrincipalNameModifier
{
private static final String COMPONENT_SEPARATOR = "/";
@@ -27,6 +29,7 @@
List components = new ArrayList();
int nameType;
+
public PrincipalName getPrincipalName()
{
StringBuffer sb = new StringBuffer();
@@ -34,7 +37,7 @@
while ( it.hasNext() )
{
- String component = (String) it.next();
+ String component = ( String ) it.next();
sb.append( component );
if ( it.hasNext() )
@@ -46,10 +49,12 @@
return new PrincipalName( sb.toString(), nameType );
}
+
public void setType( int type )
{
nameType = type;
}
+
public void addName( String name )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameType.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameType.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameType.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/PrincipalNameType.java Fri Feb 10 02:48:07 2006
@@ -16,54 +16,57 @@
*/
package org.apache.kerberos.messages.value;
+
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
+
public final class PrincipalNameType implements Comparable
{
- /**
- * Enumeration elements are constructed once upon class loading.
- * Order of appearance here determines the order of compareTo.
- */
- public static final PrincipalNameType KRB_NT_UNKNOWN =
- new PrincipalNameType(0, "unknown name type");
- public static final PrincipalNameType KRB_NT_PRINCIPAL =
- new PrincipalNameType(1, "user principal name type");
- public static final PrincipalNameType KRB_NT_SRV_INST =
- new PrincipalNameType(2, "service and other unique instance (krbtgt) name type");
- public static final PrincipalNameType KRB_NT_SRV_HST =
- new PrincipalNameType(3, "service with host name as instance (telnet, rcommands)");
- public static final PrincipalNameType KRB_NT_SRV_XHST =
- new PrincipalNameType(4, "service with host name as instance (telnet, rcommands) name type");
- public static final PrincipalNameType KRB_NT_UID =
- new PrincipalNameType(5, "unique ID name type");
- public static final PrincipalNameType KRB_NT_X500_PRINCIPAL =
- new PrincipalNameType(6, "nt x500 principal; encoded X.509 Distinguished name [RFC 2253]");
+ /**
+ * Enumeration elements are constructed once upon class loading.
+ * Order of appearance here determines the order of compareTo.
+ */
+ public static final PrincipalNameType KRB_NT_UNKNOWN = new PrincipalNameType( 0, "unknown name type" );
+ public static final PrincipalNameType KRB_NT_PRINCIPAL = new PrincipalNameType( 1, "user principal name type" );
+ public static final PrincipalNameType KRB_NT_SRV_INST = new PrincipalNameType( 2,
+ "service and other unique instance (krbtgt) name type" );
+ public static final PrincipalNameType KRB_NT_SRV_HST = new PrincipalNameType( 3,
+ "service with host name as instance (telnet, rcommands)" );
+ public static final PrincipalNameType KRB_NT_SRV_XHST = new PrincipalNameType( 4,
+ "service with host name as instance (telnet, rcommands) name type" );
+ public static final PrincipalNameType KRB_NT_UID = new PrincipalNameType( 5, "unique ID name type" );
+ public static final PrincipalNameType KRB_NT_X500_PRINCIPAL = new PrincipalNameType( 6,
+ "nt x500 principal; encoded X.509 Distinguished name [RFC 2253]" );
+
- public String toString()
+ public String toString()
{
return name + " (" + ordinal + ")";
}
+
public int compareTo( Object that )
{
- return ordinal - ( (PrincipalNameType) that ).ordinal;
+ return ordinal - ( ( PrincipalNameType ) that ).ordinal;
}
+
public static PrincipalNameType getTypeByOrdinal( int type )
{
for ( int ii = 0; ii < values.length; ii++ )
{
- if ( values[ ii ].ordinal == type )
+ if ( values[ii].ordinal == type )
{
- return values[ ii ];
+ return values[ii];
}
}
-
+
return KRB_NT_UNKNOWN;
}
+
public int getOrdinal()
{
return ordinal;
@@ -73,10 +76,11 @@
private final String name;
private final int ordinal;
+
/**
* Private constructor prevents construction outside of this class.
*/
- private PrincipalNameType( int ordinal, String name )
+ private PrincipalNameType(int ordinal, String name)
{
this.ordinal = ordinal;
this.name = name;
@@ -85,8 +89,9 @@
/**
* These two lines are all that's necessary to export a List of VALUES.
*/
- private static final PrincipalNameType[] values = { KRB_NT_UNKNOWN, KRB_NT_PRINCIPAL,
- KRB_NT_SRV_INST, KRB_NT_SRV_HST, KRB_NT_SRV_XHST, KRB_NT_UID, KRB_NT_X500_PRINCIPAL };
+ private static final PrincipalNameType[] values =
+ { KRB_NT_UNKNOWN, KRB_NT_PRINCIPAL, KRB_NT_SRV_INST, KRB_NT_SRV_HST, KRB_NT_SRV_XHST, KRB_NT_UID,
+ KRB_NT_X500_PRINCIPAL };
// VALUES needs to be located here, otherwise illegal forward reference
public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values ) );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBody.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBody.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBody.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBody.java Fri Feb 10 02:48:07 2006
@@ -16,92 +16,105 @@
*/
package org.apache.kerberos.messages.value;
+
import javax.security.auth.kerberos.KerberosPrincipal;
import org.apache.kerberos.crypto.encryption.EncryptionType;
import org.apache.kerberos.messages.components.Ticket;
+
public class RequestBody
{
- private KdcOptions kdcOptions;
- private KerberosPrincipal clientPrincipal; //optional in TgsReq only
- private KerberosPrincipal serverPrincipal;
- private KerberosTime from; //optional
- private KerberosTime till;
- private KerberosTime rtime; //optional
- private int nonce;
- private EncryptionType[] eType;
- private HostAddresses addresses; //optional
- private EncryptedData encAuthorizationData; //optional
- private Ticket[] additionalTickets; //optional
-
- public RequestBody( KdcOptions kdcOptions, KerberosPrincipal clientPrincipal,
- KerberosPrincipal serverPrincipal, KerberosTime from, KerberosTime till,
- KerberosTime rtime, int nonce, EncryptionType[] eType, HostAddresses addresses,
- EncryptedData encAuthorizationData, Ticket[] additionalTickets )
- {
- this.kdcOptions = kdcOptions;
- this.clientPrincipal = clientPrincipal;
- this.serverPrincipal = serverPrincipal;
- this.from = from;
- this.till = till;
- this.rtime = rtime;
- this.nonce = nonce;
- this.eType = eType;
- this.addresses = addresses;
+ private KdcOptions kdcOptions;
+ private KerberosPrincipal clientPrincipal; //optional in TgsReq only
+ private KerberosPrincipal serverPrincipal;
+ private KerberosTime from; //optional
+ private KerberosTime till;
+ private KerberosTime rtime; //optional
+ private int nonce;
+ private EncryptionType[] eType;
+ private HostAddresses addresses; //optional
+ private EncryptedData encAuthorizationData; //optional
+ private Ticket[] additionalTickets; //optional
+
+
+ public RequestBody(KdcOptions kdcOptions, KerberosPrincipal clientPrincipal, KerberosPrincipal serverPrincipal,
+ KerberosTime from, KerberosTime till, KerberosTime rtime, int nonce, EncryptionType[] eType,
+ HostAddresses addresses, EncryptedData encAuthorizationData, Ticket[] additionalTickets)
+ {
+ this.kdcOptions = kdcOptions;
+ this.clientPrincipal = clientPrincipal;
+ this.serverPrincipal = serverPrincipal;
+ this.from = from;
+ this.till = till;
+ this.rtime = rtime;
+ this.nonce = nonce;
+ this.eType = eType;
+ this.addresses = addresses;
this.encAuthorizationData = encAuthorizationData;
- this.additionalTickets = additionalTickets;
+ this.additionalTickets = additionalTickets;
}
+
public Ticket[] getAdditionalTickets()
{
return additionalTickets;
}
+
public HostAddresses getAddresses()
{
return addresses;
}
+
public KerberosPrincipal getClientPrincipal()
{
return clientPrincipal;
}
+
public KerberosPrincipal getServerPrincipal()
{
return serverPrincipal;
}
+
public EncryptedData getEncAuthorizationData()
{
return encAuthorizationData;
}
+
public EncryptionType[] getEType()
{
return eType;
}
+
public KerberosTime getFrom()
{
return from;
}
+
public KdcOptions getKdcOptions()
{
return kdcOptions;
}
+
public int getNonce()
{
return nonce;
}
+
public KerberosTime getRtime()
{
return rtime;
}
+
public KerberosTime getTill()
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBodyModifier.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBodyModifier.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBodyModifier.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/kerberos-shared/src/main/java/org/apache/kerberos/messages/value/RequestBodyModifier.java Fri Feb 10 02:48:07 2006
@@ -16,89 +16,104 @@
*/
package org.apache.kerberos.messages.value;
+
import javax.security.auth.kerberos.KerberosPrincipal;
import org.apache.kerberos.crypto.encryption.EncryptionType;
import org.apache.kerberos.messages.components.Ticket;
+
public class RequestBodyModifier
{
- private KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier(); //optional in TgsReq only
- private KerberosPrincipalModifier serverModifier = new KerberosPrincipalModifier();
- private KdcOptions kdcOptions;
- private KerberosTime from; //optional
- private KerberosTime till;
- private KerberosTime rtime; //optional
- private int nonce;
- private EncryptionType[] eType;
- private HostAddresses addresses; //optional
- private EncryptedData encAuthorizationData; //optional
- private Ticket[] additionalTickets; //optional
+ private KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier(); //optional in TgsReq only
+ private KerberosPrincipalModifier serverModifier = new KerberosPrincipalModifier();
+ private KdcOptions kdcOptions;
+ private KerberosTime from; //optional
+ private KerberosTime till;
+ private KerberosTime rtime; //optional
+ private int nonce;
+ private EncryptionType[] eType;
+ private HostAddresses addresses; //optional
+ private EncryptedData encAuthorizationData; //optional
+ private Ticket[] additionalTickets; //optional
- public RequestBody getRequestBody()
+
+ public RequestBody getRequestBody()
{
KerberosPrincipal clientPrincipal = clientModifier.getKerberosPrincipal();
KerberosPrincipal serverPrincipal = serverModifier.getKerberosPrincipal();
- return new RequestBody( kdcOptions, clientPrincipal, serverPrincipal, from, till,
- rtime, nonce, eType, addresses, encAuthorizationData, additionalTickets );
+ return new RequestBody( kdcOptions, clientPrincipal, serverPrincipal, from, till, rtime, nonce, eType,
+ addresses, encAuthorizationData, additionalTickets );
}
+
public void setClientName( PrincipalName clientName )
{
clientModifier.setPrincipalName( clientName );
}
+
public void setServerName( PrincipalName serverName )
{
serverModifier.setPrincipalName( serverName );
}
+
public void setRealm( String realm )
{
clientModifier.setRealm( realm );
serverModifier.setRealm( realm );
}
+
public void setAdditionalTickets( Ticket[] tickets )
{
additionalTickets = tickets;
}
+
public void setAddresses( HostAddresses addresses )
{
this.addresses = addresses;
}
+
public void setEncAuthorizationData( EncryptedData authorizationData )
{
encAuthorizationData = authorizationData;
}
+
public void setEType( EncryptionType[] type )
{
eType = type;
}
+
public void setFrom( KerberosTime from )
{
this.from = from;
}
+
public void setKdcOptions( KdcOptions options )
{
kdcOptions = options;
}
+
public void setNonce( int nonce )
{
this.nonce = nonce;
}
+
public void setRtime( KerberosTime rtime )
{
this.rtime = rtime;
}
+
public void setTill( KerberosTime till )
{
|