All Kerberos JAAS login modules that authenticate a user to a KDC should
use this class. Where available, the login module might even read this
information from a ticket cache in the operating system instead of
directly communicating with the KDC. During the commit phase of the JAAS
authentication process, the JAAS login module should instantiate this
class and store the instance in the private credential set of a
Subject.
Note that this class is applicable to both ticket granting tickets and other regular service tickets. A ticket granting ticket is just a special case of a more generalized service ticket.
Implementation Note
The JAAS login module in the JDK reference implementation destroys all tickets after logout.
javax.security.auth.Subject , javax.security.auth.login.LoginContext , org.ietf.jgss.GSSCredential , org.ietf.jgss.GSSManager
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | asn1Encoding
ASN.1 DER Encoding of the Ticket as defined in the Kerberos Protocol Specification RFC4120. |
| private Date | authTime
Time of initial authentication |
| private KerberosPrincipal | client
Client that owns the service ticket |
| private InetAddress[] | clientAddresses
The addresses from where the ticket may be used by the client. |
| pack-priv transient KerberosPrincipal | |
| private transient boolean | |
| private Date | endTime
Time after which the ticket will not be honored. |
| private boolean[] | flags
Ticket Flags as defined in the Kerberos Protocol Specification RFC4120. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv KerberosTicket | |
| private static final int | |
| private static final int | |
| private Date | renewTill
For renewable Tickets it indicates the maximum endtime that may be included in a renewal. |
| private static final long | |
| private KerberosPrincipal | server
The service for which the ticket was issued. |
| pack-priv transient KerberosPrincipal | |
| private KeyImpl | sessionKey
|
| private Date | startTime
Time after which the ticket is valid. |
| Access | Constructor and Description |
|---|---|
| public | KerberosTicket(byte[]
the ASN.1 encoding of the ticket as defined by
the Kerberos protocol specification. asn1Encoding, KerberosPrincipal the client that owns this service
ticket client, KerberosPrincipal the service that this ticket is for server, byte[] the raw bytes for the session key that must be
used to encrypt the authenticator that will be sent to the server sessionKey, int the key type for the session key as defined by the
Kerberos protocol specification. keyType, boolean[] the ticket flags. Each element in this array indicates
the value for the corresponding bit in the ASN.1 BitString that
represents the ticket flags. If the number of elements in this array
is less than the number of flags used by the Kerberos protocol,
then the missing flags will be filled in with false. flags, Date the time of initial authentication for the client authTime, Date the time after which the ticket will be valid. This
may be null in which case the value of authTime is treated as the
startTime. startTime, Date the time after which the ticket will no longer be
valid endTime, Date an absolute expiration time for the ticket,
including all renewal that might be possible. This field may be null
for tickets that are not renewable. renewTill, InetAddress[] the addresses from where the ticket may be
used by the client. This field may be null when the ticket is usable
from any address. clientAddresses)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
Overrides default javax. Destroys the ticket and destroys any sensitive information stored in it. |
| public boolean | Returns: true if the specified object is equal to thisKerberosTicket,
false otherwise.the object to compare to other)Overrides java. Compares the specified object with this |
| public final Date | Returns: the time that the client was authenticated ornull if the field is not set or
this ticket is destroyed.Returns the time that the client was authenticated. |
| public final KerberosPrincipal | Returns: the client principal, ornull if destroyed.Returns the client principal associated with this ticket. |
| public final InetAddress[] | Returns: the list of addresses, ornull if the field was not
provided or this ticket is destroyed.Returns a list of addresses from where the ticket can be used. |
| public final byte[] | Returns: an ASN.1 encoding of the entire ticket. A new byte array is returned each time this method is called.Returns an ASN.1 encoding of the entire ticket. |
| public final Date | Returns: the expiration time for this ticket's validity period, ornull if destroyed.Returns the expiration time for this ticket's validity period. |
| public final boolean[] | Returns: the flags associated with this ticket, ornull
if destroyed.Returns the flags associated with this ticket. |
| public final Date | Returns: the latest expiration time for this ticket, ornull
if destroyed.Returns the latest expiration time for this ticket, including all renewals. |
| public final KerberosPrincipal | Returns: the service principal, ornull if destroyed.Returns the service principal associated with this ticket. |
| public final SecretKey | |
| public final int | Returns: the key type of the session key associated with this ticket.Returns the key type of the session key associated with this ticket as defined by the Kerberos Protocol Specification. |
| public final Date | Returns: the start time for this ticket's validity period ornull if the field is not set or
this ticket is destroyed.Returns the start time for this ticket's validity period. |
| public int | Returns: a hash code for thisKerberosTicketOverrides java. Returns a hash code for this |
| private void | init(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, byte[] sessionKey, int keyType, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses)
|
| private void | init(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, KeyImpl sessionKey, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses)
|
| public boolean | Returns: true if this ticket is still current, or false if not current or destroyed.Implements javax. Determines if this ticket is still current. |
| public boolean | isDestroyed()
Overrides default javax. Determines if this ticket has been destroyed. |
| public final boolean | Returns: true if this ticket is forwardable, or false if not forwardable or destroyed.Determines if this ticket is forwardable. |
| public final boolean | Returns: true if this ticket had been forwarded or was issued based on authentication involving a forwarded ticket-granting ticket, or false otherwise or destroyed.Determines if this ticket had been forwarded or was issued based on authentication involving a forwarded ticket-granting ticket. |
| public final boolean | Returns: true if this ticket was issued using the Kerberos AS-Exchange protocol, or false if not issued this way or destroyed.Determines if this ticket was issued using the Kerberos AS-Exchange protocol, and not issued based on some ticket-granting ticket. |
| public final boolean | Returns: true if this ticket is post-dated, or false if not post-dated or destroyed.Determines is this ticket is post-dated. |
| public final boolean | Returns: true if this ticket is proxiable, or false if not proxiable or destroyed.Determines if this ticket is proxiable. |
| public final boolean | Returns: true if this ticket is a proxy-ticket, or false if not a proxy-ticket or destroyed.Determines is this ticket is a proxy-ticket. |
| public final boolean | Returns: true if this ticket is renewable, or false if not renewable or destroyed.Determines is this ticket is renewable. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readRestores the state of this object from the stream. |
| public void | refresh()
Implements javax. Extends the validity period of this ticket. |
| public String | Returns: an informative textual representation of thisKerberosTicket.Overrides java. Returns an informative textual representation of this |
| asn1Encoding | back to summary |
|---|---|
| private byte[] asn1Encoding ASN.1 DER Encoding of the Ticket as defined in the Kerberos Protocol Specification RFC4120. | |
| authTime | back to summary |
|---|---|
| private Date authTime Time of initial authentication | |
| client | back to summary |
|---|---|
| private KerberosPrincipal client Client that owns the service ticket | |
| clientAddresses | back to summary |
|---|---|
| private InetAddress[] clientAddresses The addresses from where the ticket may be used by the client. This field may be null when the ticket is usable from any address. | |
| clientAlias | back to summary |
|---|---|
| pack-priv transient KerberosPrincipal clientAlias | |
| destroyed | back to summary |
|---|---|
| private transient boolean destroyed | |
| endTime | back to summary |
|---|---|
| private Date endTime Time after which the ticket will not be honored. (its expiration time). | |
| flags | back to summary |
|---|---|
| private boolean[] flags Ticket Flags as defined in the Kerberos Protocol Specification RFC4120. | |
| FORWARDABLE_TICKET_FLAG | back to summary |
|---|---|
| private static final int FORWARDABLE_TICKET_FLAG | |
| FORWARDED_TICKET_FLAG | back to summary |
|---|---|
| private static final int FORWARDED_TICKET_FLAG | |
| INITIAL_TICKET_FLAG | back to summary |
|---|---|
| private static final int INITIAL_TICKET_FLAG | |
| NUM_FLAGS | back to summary |
|---|---|
| private static final int NUM_FLAGS | |
| POSTDATED_TICKET_FLAG | back to summary |
|---|---|
| private static final int POSTDATED_TICKET_FLAG | |
| PROXIABLE_TICKET_FLAG | back to summary |
|---|---|
| private static final int PROXIABLE_TICKET_FLAG | |
| proxy | back to summary |
|---|---|
| pack-priv KerberosTicket proxy | |
| PROXY_TICKET_FLAG | back to summary |
|---|---|
| private static final int PROXY_TICKET_FLAG | |
| RENEWABLE_TICKET_FLAG | back to summary |
|---|---|
| private static final int RENEWABLE_TICKET_FLAG | |
| renewTill | back to summary |
|---|---|
| private Date renewTill For renewable Tickets it indicates the maximum endtime that may be included in a renewal. It can be thought of as the absolute expiration time for the ticket, including all renewals. This field may be null for tickets that are not renewable. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID
| |
| server | back to summary |
|---|---|
| private KerberosPrincipal server The service for which the ticket was issued. | |
| serverAlias | back to summary |
|---|---|
| pack-priv transient KerberosPrincipal serverAlias | |
| sessionKey | back to summary |
|---|---|
| private KeyImpl sessionKey
EncryptionKey ::= SEQUENCE {
keytype [0] Int32 -- actually encryption type --,
keyvalue [1] OCTET STRING
}
| |
| startTime | back to summary |
|---|---|
| private Date startTime Time after which the ticket is valid. | |
| KerberosTicket | back to summary |
|---|---|
| public KerberosTicket(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, byte[] sessionKey, int keyType, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses) Constructs a
| |
| destroy | back to summary |
|---|---|
| public void destroy() throws DestroyFailedException Overrides default javax. Destroys the ticket and destroys any sensitive information stored in it.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Compares the specified object with this | |
| getAuthTime | back to summary |
|---|---|
| public final Date getAuthTime() Returns the time that the client was authenticated.
| |
| getClient | back to summary |
|---|---|
| public final KerberosPrincipal getClient() Returns the client principal associated with this ticket.
| |
| getClientAddresses | back to summary |
|---|---|
| public final InetAddress[] getClientAddresses() Returns a list of addresses from where the ticket can be used.
| |
| getEncoded | back to summary |
|---|---|
| public final byte[] getEncoded() Returns an ASN.1 encoding of the entire ticket.
| |
| getEndTime | back to summary |
|---|---|
| public final Date getEndTime() Returns the expiration time for this ticket's validity period.
| |
| getFlags | back to summary |
|---|---|
| public final boolean[] getFlags() Returns the flags associated with this ticket. Each element in the returned array indicates the value for the corresponding bit in the ASN.1 BitString that represents the ticket flags.
| |
| getRenewTill | back to summary |
|---|---|
| public final Date getRenewTill() Returns the latest expiration time for this ticket, including all renewals. This will return a null value for non-renewable tickets.
| |
| getServer | back to summary |
|---|---|
| public final KerberosPrincipal getServer() Returns the service principal associated with this ticket.
| |
| getSessionKey | back to summary |
|---|---|
| public final SecretKey getSessionKey() Returns the session key associated with this ticket. The return value
is always a
| |
| getSessionKeyType | back to summary |
|---|---|
| public final int getSessionKeyType() Returns the key type of the session key associated with this ticket as defined by the Kerberos Protocol Specification.
| |
| getStartTime | back to summary |
|---|---|
| public final Date getStartTime() Returns the start time for this ticket's validity period.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hash code for this
| |
| init | back to summary |
|---|---|
| private void init(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, byte[] sessionKey, int keyType, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses) | |
| init | back to summary |
|---|---|
| private void init(byte[] asn1Encoding, KerberosPrincipal client, KerberosPrincipal server, KeyImpl sessionKey, boolean[] flags, Date authTime, Date startTime, Date endTime, Date renewTill, InetAddress[] clientAddresses) | |
| isCurrent | back to summary |
|---|---|
| public boolean isCurrent() Implements javax. Determines if this ticket is still current.
| |
| isDestroyed | back to summary |
|---|---|
| public boolean isDestroyed() Overrides default javax. Determines if this ticket has been destroyed. | |
| isForwardable | back to summary |
|---|---|
| public final boolean isForwardable() Determines if this ticket is forwardable.
| |
| isForwarded | back to summary |
|---|---|
| public final boolean isForwarded() Determines if this ticket had been forwarded or was issued based on authentication involving a forwarded ticket-granting ticket.
| |
| isInitial | back to summary |
|---|---|
| public final boolean isInitial() Determines if this ticket was issued using the Kerberos AS-Exchange protocol, and not issued based on some ticket-granting ticket.
| |
| isPostdated | back to summary |
|---|---|
| public final boolean isPostdated() Determines is this ticket is post-dated.
| |
| isProxiable | back to summary |
|---|---|
| public final boolean isProxiable() Determines if this ticket is proxiable.
| |
| isProxy | back to summary |
|---|---|
| public final boolean isProxy() Determines is this ticket is a proxy-ticket.
| |
| isRenewable | back to summary |
|---|---|
| public final boolean isRenewable() Determines is this ticket is renewable. If so, the
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Restores the state of this object from the stream.
| |
| refresh | back to summary |
|---|---|
| public void refresh() throws RefreshFailedException Implements javax. Extends the validity period of this ticket. The ticket will contain a new session key if the refresh operation succeeds. The refresh operation will fail if the ticket is not renewable or the latest allowable renew time has passed. Any other error returned by the KDC will also cause this method to fail. Note This method is not synchronized with the accessor methods of this object. Hence callers need to be aware of multiple threads that might access this and try to renew it at the same time.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns an informative textual representation of this
| |