summaryrefslogtreecommitdiff
path: root/javax
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2010-01-30 01:58:19 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2010-01-30 01:58:19 +0000
commit4912253423cb1c182cf42d26502f841f103f83c2 (patch)
tree5781e978200104f7952f8638597ceb2f9f7972cd /javax
parentec35e91f1d1ef06008da3b60c49d7f0642b9c8db (diff)
downloadclasspath-4912253423cb1c182cf42d26502f841f103f83c2.tar.gz
PR classpath/41686 Implement KerberosTicket.getSessionKeyType()
2010-01-30 Andrew John Hughes <ahughes@redhat.com> PR classpath/41686 * javax/security/auth/kerberos/KerberosTicket.java: Fix formatting. (toString()): Add full implementation. (getSessionKeyType()): Implemented. * javax/security/auth/kerberos/KeyImpl.java: (toString()): Implemented.
Diffstat (limited to 'javax')
-rw-r--r--javax/security/auth/kerberos/KerberosTicket.java51
-rw-r--r--javax/security/auth/kerberos/KeyImpl.java9
2 files changed, 51 insertions, 9 deletions
diff --git a/javax/security/auth/kerberos/KerberosTicket.java b/javax/security/auth/kerberos/KerberosTicket.java
index 85e253749..ff70b9f4e 100644
--- a/javax/security/auth/kerberos/KerberosTicket.java
+++ b/javax/security/auth/kerberos/KerberosTicket.java
@@ -54,7 +54,7 @@ import javax.security.auth.Refreshable;
* This class represents a Kerberos ticket. See the Kerberos
* authentication RFC for more information:
* <a href="http://www.ietf.org/rfc/rfc1510.txt">RFC 1510</a>.
- *
+ *
* @since 1.4
*/
public class KerberosTicket
@@ -86,16 +86,16 @@ public class KerberosTicket
/**
* Create a new ticket given all the facts about it.
- *
+ *
* Note that flags may be null or "short"; any flags not specified
* will be taken to be false.
- *
+ *
* If the key is not renewable, then renewTill may be null.
- *
+ *
* If authTime is null, then it is taken to be the same as startTime.
- *
+ *
* If clientAddresses is null, then the ticket can be used anywhere.
- *
+ *
* @param asn1Encoding the contents of the ticket, as ASN1
* @param client the client principal
* @param server the server principal
@@ -279,7 +279,7 @@ public class KerberosTicket
{
return (Date) startTime.clone();
}
-
+
/**
* Return the end time for this ticket.
*/
@@ -287,7 +287,7 @@ public class KerberosTicket
{
return (Date) endTime.clone();
}
-
+
/**
* Return the renewal time for this ticket. For a non-renewable
* ticket, this will return null.
@@ -334,6 +334,39 @@ public class KerberosTicket
public String toString()
{
- return "FIXME bob";
+ return getClass().getName() +
+ "[client=" + client +
+ ",server=" + server +
+ ",sessionKey=" + sessionKey +
+ ",flags=" + flags +
+ ",authTime=" + authTime +
+ ",startTime= " + startTime +
+ ",endTime=" + endTime +
+ ",renewTill=" + renewTill +
+ ",clientAddresses=" + clientAddresses +
+ "]";
+ }
+
+ /**
+ * <p>
+ * Returns the type of the session key in accordance with
+ * RFC1510. This usually corresponds to the encryption
+ * algorithm used by the key, though more than one algorithm
+ * may use the same key type (e.g. DES with different checksum
+ * mechanisms and chaining modes). Negative values are reserved
+ * for local use. Non-negative values are for officially assigned
+ * type fields. The RFC defines:
+ * </p>
+ * <ul>
+ * <li>0 &mdash; null</li>
+ * <li>1 &mdash; DES (in CBC mode with either MD4 or MD5 checksums)</li>
+ * </ul>
+ *
+ * @return the type of session key used by this ticket.
+ */
+ public final int getSessionKeyType()
+ {
+ return sessionKey.type;
}
+
}
diff --git a/javax/security/auth/kerberos/KeyImpl.java b/javax/security/auth/kerberos/KeyImpl.java
index 6773dfa3e..a7cf3d212 100644
--- a/javax/security/auth/kerberos/KeyImpl.java
+++ b/javax/security/auth/kerberos/KeyImpl.java
@@ -90,4 +90,13 @@ final class KeyImpl implements Serializable, SecretKey
// FIXME.
return null;
}
+
+ public String toString()
+ {
+ return getClass().getName() +
+ "[type=" + type +
+ ",algorithm=" + algorithm +
+ "]";
+ }
+
}