APIdia Launch Partner
Top Description Fields Constructors Methods
javax.security.auth.kerberos

public final Class KerberosCredMessage

extends Object
implements Destroyable
Class Inheritance
All Implemented Interfaces
javax.security.auth.Destroyable
Imports
javax.security.auth.Destroyable, java.util.Arrays, .Objects

This class encapsulates a Kerberos 5 KRB_CRED message which can be used to send Kerberos credentials from one principal to another.

A KRB_CRED message is defined in Section 5.8.1 of the Kerberos Protocol Specification (RFC 4120) as:

   KRB-CRED        ::= [APPLICATION 22] SEQUENCE {
           pvno            [0] INTEGER (5),
           msg-type        [1] INTEGER (22),
           tickets         [2] SEQUENCE OF Ticket,
           enc-part        [3] EncryptedData -- EncKrbCredPart
   }
Since
9

Field Summary

Modifier and TypeField and Description
private boolean
private final byte[]
private final KerberosPrincipal
private final KerberosPrincipal

Constructor Summary

AccessConstructor and Description
public
KerberosCredMessage(KerberosPrincipal
the sender of the message
sender
,
KerberosPrincipal
the recipient of the message
recipient
,
byte[]
the DER encoded KRB_CRED message
message
)

Constructs a KerberosCredMessage object.

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroys this object by clearing out the message.

public boolean

Returns:

true if the specified object is equal to this KerberosCredMessage, false otherwise.
equals
(Object
the object to compare to
other
)

Overrides java.lang.Object.equals.

Compares the specified object with this KerberosCredMessage for equality.

public byte[]

Returns:

a newly allocated byte array that contains the encoded form
getEncoded
()

Returns the DER encoded form of the KRB_CRED message.

public KerberosPrincipal

Returns:

the recipient
getRecipient
()

Returns the recipient of this message.

public KerberosPrincipal

Returns:

the sender
getSender
()

Returns the sender of this message.

public int

Returns:

a hash code for this KerberosCredMessage
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this KerberosCredMessage.

public boolean
isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

public String

Returns:

an informative textual representation of this KerberosCredMessage.
toString
()

Overrides java.lang.Object.toString.

Returns an informative textual representation of this KerberosCredMessage.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

destroyedback to summary
private boolean destroyed
messageback to summary
private final byte[] message
recipientback to summary
private final KerberosPrincipal recipient
senderback to summary
private final KerberosPrincipal sender

Constructor Detail

KerberosCredMessageback to summary
public KerberosCredMessage(KerberosPrincipal sender, KerberosPrincipal recipient, byte[] message)

Constructs a KerberosCredMessage object.

The contents of the message argument are copied; subsequent modification of the byte array does not affect the newly created object.

Parameters
sender:KerberosPrincipal

the sender of the message

recipient:KerberosPrincipal

the recipient of the message

message:byte[]

the DER encoded KRB_CRED message

Exceptions
NullPointerException:
if any of sender, recipient or message is null

Method Detail

destroyback to summary
public void destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroys this object by clearing out the message.

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Compares the specified object with this KerberosCredMessage for equality. Returns true if the given object is also a KerberosCredMessage and the two KerberosCredMessage instances are equivalent. More formally two KerberosCredMessage instances are equal if they have equal sender, recipient, and encoded KRB_CRED messages. A destroyed KerberosCredMessage object is only equal to itself.

Parameters
other:Object

the object to compare to

Returns:boolean

true if the specified object is equal to this KerberosCredMessage, false otherwise.

Annotations
@Override
getEncodedback to summary
public byte[] getEncoded()

Returns the DER encoded form of the KRB_CRED message.

Returns:byte[]

a newly allocated byte array that contains the encoded form

Exceptions
IllegalStateException:
if the object is destroyed
getRecipientback to summary
public KerberosPrincipal getRecipient()

Returns the recipient of this message.

Returns:KerberosPrincipal

the recipient

Exceptions
IllegalStateException:
if the object is destroyed
getSenderback to summary
public KerberosPrincipal getSender()

Returns the sender of this message.

Returns:KerberosPrincipal

the sender

Exceptions
IllegalStateException:
if the object is destroyed
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this KerberosCredMessage.

Returns:int

a hash code for this KerberosCredMessage

Annotations
@Override
isDestroyedback to summary
public boolean isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Doc from javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns an informative textual representation of this KerberosCredMessage.

Returns:String

an informative textual representation of this KerberosCredMessage.

Annotations
@Override