java.lang.Object
javax.security.auth.kerberos.KerberosCredMessage
- All Implemented Interfaces:
- Destroyable
public final class KerberosCredMessage extends Object implements Destroyable
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
- 
Constructor SummaryConstructors Constructor Description KerberosCredMessage(KerberosPrincipal sender, KerberosPrincipal recipient, byte[] message)Constructs aKerberosCredMessageobject.
- 
Method SummaryModifier and Type Method Description voiddestroy()Destroys this object by clearing out the message.booleanequals(Object other)Compares the specified object with thisKerberosCredMessagefor equality.byte[]getEncoded()Returns the DER encoded form of the KRB_CRED message.KerberosPrincipalgetRecipient()Returns the recipient of this message.KerberosPrincipalgetSender()Returns the sender of this message.inthashCode()Returns a hash code for thisKerberosCredMessage.StringtoString()Returns an informative textual representation of thisKerberosCredMessage.
- 
Constructor Details- 
KerberosCredMessageConstructs aKerberosCredMessageobject.The contents of the messageargument are copied; subsequent modification of the byte array does not affect the newly created object.- Parameters:
- sender- the sender of the message
- recipient- the recipient of the message
- message- the DER encoded KRB_CRED message
- Throws:
- NullPointerException- if any of sender, recipient or message is null
 
 
- 
- 
Method Details- 
getEncodedpublic byte[] getEncoded()Returns the DER encoded form of the KRB_CRED message.- Returns:
- a newly allocated byte array that contains the encoded form
- Throws:
- IllegalStateException- if the object is destroyed
 
- 
getSenderReturns the sender of this message.- Returns:
- the sender
- Throws:
- IllegalStateException- if the object is destroyed
 
- 
getRecipientReturns the recipient of this message.- Returns:
- the recipient
- Throws:
- IllegalStateException- if the object is destroyed
 
- 
destroypublic void destroy()Destroys this object by clearing out the message.- Specified by:
- destroyin interface- Destroyable
 
- 
toStringReturns an informative textual representation of thisKerberosCredMessage.
- 
hashCodepublic int hashCode()Returns a hash code for thisKerberosCredMessage.- Overrides:
- hashCodein class- Object
- Returns:
- a hash code for this KerberosCredMessage.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
- 
equalsCompares the specified object with thisKerberosCredMessagefor equality. Returns true if the given object is also aKerberosCredMessageand the twoKerberosCredMessageinstances are equivalent. More formally twoKerberosCredMessageinstances are equal if they have equal sender, recipient, and encoded KRB_CRED messages. A destroyedKerberosCredMessageobject is only equal to itself.- Overrides:
- equalsin class- Object
- Parameters:
- other- the object to compare to
- Returns:
- true if the specified object is equal to this
 KerberosCredMessage, false otherwise.
- See Also:
- Object.hashCode(),- HashMap
 
 
-