directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 55077 - incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/value
Date Tue, 19 Oct 2004 17:19:37 GMT
Author: erodriguez
Date: Tue Oct 19 10:19:36 2004
New Revision: 55077

Modified:
   incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/value/EncryptionKey.java
Log:
Implemented equals method.  Required for comparing keys coming off wire and retrived from
JNDI backend.

Modified: incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/value/EncryptionKey.java
==============================================================================
--- incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/value/EncryptionKey.java
(original)
+++ incubator/directory/kerberos/trunk/source/main/org/apache/kerberos/messages/value/EncryptionKey.java
Tue Oct 19 10:19:36 2004
@@ -18,6 +18,8 @@
 
 import org.apache.kerberos.crypto.encryption.*;
 
+import java.util.*;
+
 public class EncryptionKey {
 	
 	private EncryptionType _keyType;
@@ -42,7 +44,18 @@
 		 */
 		_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));
+	}
+	
 	public synchronized void destroy() {
 		if (_keyValue != null)
 			for (int i = 0; i < _keyValue.length; i++)

Mime
View raw message